Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Textbox Validation 1

Status
Not open for further replies.

vestax22

Programmer
Jun 18, 2003
139
CA
Hi, I created an Excel application that calls a userform. Inside this form I have many text boxes which I would like to validate and since there are no format or input mask properties in VBA textboxm I have to do it manually.

I want to use the keypress event to make sure that only numeric values are entered inside a specific textbox. Does anyone here know how to do this?

Any help would be greatly appreciated

Thx




 
In the keypress event:

If KeyAscii < 48 Or KeyAscii> 57 Then
KeyAscii = 0
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top