How can I check if a String contains another String using VBA 6.0?

How can I do a check to see if String 'x' contains String 'y' anywhere within using VBA 6.0?
MaineBiotechAsked:
Who is Participating?
 
Patrick MatthewsConnect With a Mentor Commented:
If InStr(1, StringX, StringY) > 0 Then
    'contains
Else
    'does not contain
End If
0
 
Patrick MatthewsCommented:
MaineBiotech,

The 1 is not fixed; use it to force what position to start the search at.  There is also an optional argument
for which text comparison mode to use.  See the help file for more details.

Regards,

Patrick
0
 
MaineBiotechAuthor Commented:
Perfect, thank you very 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.