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

Getting a string out of numbers!

Status
Not open for further replies.

bomayed

Technical User
May 13, 2002
101
0
0
AE
If I have this line : 3233 Washington D.C

and I want to get only the string in that line which is "Washington D.C" How do I do that?
 
Instr returns the position of the first ocurance in a string, so we find the first space, add one to it (to omit the space), and use mid to get part of the string

Code:
Address = "3233 Washington D.C"
Street = Mid(Address, InStr(1, Address, " ") + 1, Len(Address))
Debug.Print Street
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top