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

How do you trim all text before special characters

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Say that I have a string that reads:
"lastname, firstname - company"

How would I trim all the text behind the comma such that it would no read:
"lastname,"
 
try this
Dim MyString, MyArray, Msg
MyString = "lastname, firstname - company"

MyArray = Split(MyString, ",", -1, 1)

Msg = MyArray(0)
MsgBox Msg [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top