Use the KeyPress event for the text box to only allow alpha characters. Check the help files for ASCII keys if you need to add more.
Code:
Private Sub TextBox1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 97 To 122, 65 To 90
KeyAscii = KeyAscii
Case Else
MsgBox "Only alpha characters are allowed.", vbInformation, "Invalid Key"
KeyAscii = 0 'key nothing
End Select
End Sub
I tried your method but unfortunately I had no success
I ended up finding this though
Code:
Private Sub txtName_keypress(ByVal keyascii As MSForms.ReturnInteger)
If keyascii >= Asc("A") And keyascii <= Asc("z") Then
keyascii = Asc(Chr(keyascii))
Else
keyascii = 0
End If
End Sub
Trouble with those routines, is that it doesn't allow you to use backspace if you make a mistake. or some people have hyphen's or spaces in their name which doesn't allow for.