• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to find multiple strings one string

ThrottleWorks

Excel Ninja
Hi,

I need to find multiple strings in one string. for example, I need to find 'Yamaha' and 'best' in one string. If I get the result I need to process further.

For example, cell A1 value = "Yamaha is the best bike in world". In this string I am getting both Yamaha and best so I should process further. How do I do this.

Can anyone please help me in this.
 
Hello Throttle
May be
Code:
Sub Test()
    Dim str As String
   
    str = Range("A1").Value
   
    If InStr(str, "Yamaha") > 0 And InStr(str, "best") > 0 Then
        MsgBox "Found", vbInformation
    Else
        MsgBox "Not Found", vbExclamation
    End If
End Sub
 
Back
Top