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

Locate a certain letter in a name

Status
Not open for further replies.

dukkse

Technical User
Oct 15, 2003
42
US
Hey!!

We have a client naming standard that ends with number, ex. ws0004, ws0125 and so on.
It want to determine what the fourth last number is (always the fourth last number) to see if it is a client with a number higher that 1000.

How do I easiest get this info??? I need to use it in a IF.. Then, like If xnumber > 1 then blabla, else bla bla

Thanks

/Daniel
 
What about this ?
Code:
tst=Right(ClientName,4)
If IsNumeric(tst) And tst>="1000" Then
  blah blah
Else
  Another blah blah
End If

Hope This Help
PH.
 
Hey PH.

Worked great, but since it is numbers I removed the " " around 1000.

Thanks
 
dukkse, if you're absolutely sure it is allways numbers, you can also suppress the IsNumeric test. If not, keep the quotes around 1000 to avoid sort of Type mismatch error.

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top