Outook 2003 VBA: Removing all left data from string

Hello, still new to this stuff...

have a string which varies in size.  I need to look for "RUN" then remove everything to the left of it........
THanks.

TechMonsterAsked:
Who is Participating?
 
wwnosalConnect With a Mentor Commented:
Try this:
Sub test()
 
Dim s As String
Dim l As Integer, idx As Variant
Dim result As String
s = "djlfajjdads ffl RUN fdsalfjsa"
l = Len(s)
idx = InStr(s, "RUN")
result = Mid(s, idx, l - idx)
End Sub

Open in new window

0
 
TechMonsterAuthor Commented:
Thank wwnosal..will this also get the data to the right of the string....
say if i had

"asldj aldslk aldj RUN  Want to keep this side of text. "
.

SO results:
"Run Want to keep this side of text"
0
 
TechMonsterAuthor Commented:
thnks much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.