title: VBA Macros - How to find multiple words within a row?
body: <p>I have a sheet containing various column where I need to search a record containing up to 3 words within a single row. I'm trying to create a Macro. I have written the following code but finding difficulty at two places:</p>
  
  <ol>
  <li><p>if <code>Activecell</code> is not an exact match but contains some of the words in Textbox1</p></li>
  <li><p>search is never ending and goes in loop</p></li>
  </ol>
  
  <p><strong>My Code</strong></p>
  
  <pre><code>Private Sub Findcheck_Click()
  
  Dim rgfound1 As Range
  Dim rgfound2 As Range
  Dim rgfound3 As Range
  
  GoTo msearch
  msearch:
  
  Set rgfound1 = Cells.Find(TextBox1)
  
  Cells.Find(What:=TextBox1, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
          :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
          False, SearchFormat:=False).Activate
  
  If rgfound1 Is Nothing Then
      MsgBox "Not Found"
      GoTo mexit
  End If
  
  If ActiveCell.Value = TextBox1 Then
      Rows(ActiveCell.Row).Select
  
      Set rgfound2 = Rows(ActiveCell.Row).Find(TextBox2)
      If rgfound2 Is Nothing Then
          ActiveCell.Offset(1, 0).Select
          GoTo msearch
      End If
  
      Set rgfound3 = Rows(ActiveCell.Row).Find(TextBox3)
      If rgfound3 Is Nothing Then
          ActiveCell.Offset(1, 0).Select
          GoTo msearch
      Else
          MsgBox "Found"
      End If
  
  End If
  
  mexit:
  
  End Sub
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/MuyYv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MuyYv.png" alt="enter image description here"></a></p>