Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox format
How do I get a textbox to only allow numbers
Thanks in advance Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox format
Hi Greg
You could use the Keypress event from your textbox and then using the KeyAscii, check each input allowing only numbers. HTH Cordially Pascal "Greg B" a écrit dans le message de ... How do I get a textbox to only allow numbers Thanks in advance Greg |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox format
Sorry to be a pain how do I do that?
Thanks again Greg |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox format
Greg,
This allows numbers, - and .. Adjust to suit Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case 48 To 57 'Nos 0 - 9 Exit Sub Case 45, 46 ' - and . Exit Sub Case Else Application.EnableEvents = False KeyAscii = 0 Application.EnableEvents = True Beep End Select End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Greg B" wrote in message ... Sorry to be a pain how do I do that? Thanks again Greg |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox format
thanks Bob for your help
Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
TextBox format? | Excel Discussion (Misc queries) | |||
TextBox format? | Excel Discussion (Misc queries) | |||
TextBox Format | Excel Discussion (Misc queries) | |||
textbox - format for dates (mm/dd/yyy) | Excel Programming | |||
Format Textbox as % | Excel Programming |