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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validating TextBox input

Status
Not open for further replies.

logius

Programmer
Aug 30, 2001
175
US
Here's the situation: there's a userform with multiple textboxes and one of them may have data that needs to be manipulated before it can be inserted into a worksheet. More specifically a serial number in the format of:

X100001
X100002
X100003
etc..

Where "X" is a single letter that may change ("A", "V", "M", etc). Now in the event that the person entering the serial number accidentally enters in a leading letter ("X") then is there a way to remove that letter so that only the number remains? Also, is there a way to verify that the serial number has exactly 6 digits?

----------------------------------------
If you are reading this, then you have read too far... :p
 
Have a look at the Len and IsNumeric functions.
Alternatively you may consider the Like operator.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Maybe you could also use the InputMask Property of the textbox ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top