+ Reply to Thread
Results 1 to 4 of 4

search for multiple words in a string

Hybrid View

  1. #1
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: search for multiple words in a string

    For example:
    Sub pcbpinoy()
    Dim s$
    s = "CD_HJ_TY_AB"
    If InStr(s, "AB") Then MsgBox "Found AB"
    If InStr(s, "AB") And InStr(s, "CD") Then MsgBox "Found AB and CD"
    End Sub

  2. #2
    Registered User
    Join Date
    10-18-2011
    Location
    KamoteLand
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: search for multiple words in a string

    thanks a lot.. i was doing

    s = "CD_HJ_TY_AB"
    If (InStr(s, "AB") =1) And (InStr(s, "CD")=1)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1