textboxes
Bob,
The code would need to check for decimal points as well as number keypad
usage, so it would need three more cases: period, number keypad numbers, and
number keypad decimal.
Bernie
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
|