B
BOBODD
Someone else posted this really useful code for validating textboxes:
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case 48 To 57 'numbers
Case Else 'Discard anything else
Beep
KeyAscii = 0
End Select
End Sub
Only problem is that I have numerous textboxes to check and I've currently
listed this for every box.
How do I package this so that for each textbox I can use something similar to:
Private Sub txtBankNum4_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Call NumCheck
End Sub
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case 48 To 57 'numbers
Case Else 'Discard anything else
Beep
KeyAscii = 0
End Select
End Sub
Only problem is that I have numerous textboxes to check and I've currently
listed this for every box.
How do I package this so that for each textbox I can use something similar to:
Private Sub txtBankNum4_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Call NumCheck
End Sub