Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox validation
hi!
i have a multipage within a form. the multipage has several textboxes. some of them use the values of the others textboxes to do math thing, like adds. everything goes wrong when the user capture characters. how can i ensure the user to capture only numbers, integer numbers? tia. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
textbox validation
Hi Begi,
Here is a textbox event that only allows numeric input Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case 48 To 57 'Nos 0 - 9 Exit Sub Case 32 ' space Case Else Application.EnableEvents = False KeyAscii = 0 Application.EnableEvents = True Beep End Select End Sub It also allows spaces, if you don't want that remove the line Case 32 ' space -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Beginner" wrote in message ... hi! i have a multipage within a form. the multipage has several textboxes. some of them use the values of the others textboxes to do math thing, like adds. everything goes wrong when the user capture characters. how can i ensure the user to capture only numbers, integer numbers? tia. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Textbox validation | Excel Discussion (Misc queries) | |||
show the input message of a data validation list on a textbox and set editable | Excel Discussion (Misc queries) | |||
putting validation to TextBox in the userform | Excel Programming | |||
putting validation to TextBox in the userform | Excel Programming | |||
Userform Textbox in Password Validation | Excel Programming |