View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Help with specific textbox entry...

The entry has to be:
- A six digit number
OR
-A five digit number, preceeded by an 'M', or an 'S', or a 'R'


You can test the entry like this...

If Entry Like "[0-9MSR]#####" Then
' VALID entry
Else
' INVALID entry
End If

Note that the test is case sensitive; that is, it will validate on M, S or R
as the first character and fail if m, s or r is used instead. If you need
the test to be case insensitive, then change the If..Then statement to
this...

If Entry Like "[0-9MmSsRr]#####" Then

Rick Rothstein (MVP - Excel)