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

Give the characters after a searched string

Status
Not open for further replies.

flaviooooo

Programmer
Joined
Feb 24, 2003
Messages
496
Location
FR
Hey,

Can this be done?

I have a string value, that contains a word that I'm looking for. Now I would like to return the 3 characters, that follow this word.

For example the string is "Cost Center: 123" and I would like to return the 123

How can I achieve this? I think there is a fairly simple way to do it, but I can't remember...
 
Some notes:

[tt]strSearch = "Cost Center: 123"
strFor = "Cost Center: "

Debug.Print Mid(strSearch, InStr(strSearch, strFor) + Len(strFor))[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top