Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox accepts alpha only
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! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox accepts alpha only
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! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox accepts alpha only
thanks Patrick!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I sort alpha neumeric fields that have an alpha suffix? | Excel Worksheet Functions | |||
Function that accepts and returns a decimal, is it possible? | Excel Worksheet Functions | |||
The colums changed from alpha to numeric how do you make it alpha | Excel Discussion (Misc queries) | |||
TextBox that only accepts integers? | Excel Programming | |||
Sheet Name not accepts special characters | Excel Programming |