hello there! i have this 3 textboxes then what i want to do is to
accept alpha only..because my textbox labeled as the name of a person.
thanks!
hello there! i have this 3 textboxes then what i want to do is to
accept alpha only..because my textbox labeled as the name of a person.
thanks!
use the textbox's key press to trap and test which key was pressed.
The code below will allow a space, a hyphen, uppercase and lowercase letter
only. Anything else, then keyascii is set to 0, so nothing gets added to the
text
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case 32, 45, 65 To 90, 97 To 122
''do nothing, these are OK
Case Else
' clear the key, we don't want it
KeyAscii = 0
End Select
End Sub
"LeLi" wrote:
> hello there! i have this 3 textboxes then what i want to do is to
> accept alpha only..because my textbox labeled as the name of a person.
> thanks!
>
>
thanks Patrick!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks