Modified from a previous post:
Create a small userform with a single textbox on it. Use the X button to close
the userform.
Put this code in a General module show the userform:
Option Explicit
Sub testme01()
UserForm1.Show
End Sub
Add this code to the userform module:
Option Explicit
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
'only 0-9, a-z, and A-Z
Case Asc("0") To Asc("9"), Asc("a") To Asc("z"), Asc("A") To Asc("Z")
With ActiveCell
.Value = Chr(KeyAscii)
'if you want to fill A:E, you could use
'If ActiveCell.Column = 5 then '5 is column E
'or
'use this for all columns.
If ActiveCell.Column = Columns.Count Then
ActiveCell.EntireRow.Cells(1).Offset(1, 0).Activate
Else
.Offset(0, 1).Activate
End If
End With
End Select
KeyAscii = 0
TextBox1.Value = ""
End Sub
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Debra Dalgleish has some getstarted instructions for userforms at:
http://contextures.com/xlUserForm01.html