title: Search two words at once
body: <p>I can search two words for example: LED LIGHT.</p>
  <p>I want to search at once &quot;LED LIGHT&quot; or &quot;LIGHT LED&quot; no matter where &quot;LED&quot; or &quot;LIGHT&quot; is within the text.</p>
  <p>Replacing the &quot;space&quot; between the words with wildcard &quot;*&quot; does help searching &quot;LED LIGHT&quot; regardless of the words position in text, but would not search in reverse &quot;LIGHT LED&quot;.</p>
  <pre><code>Dim ws As Worksheet
  Dim firstWord As String
  Dim secondWord As String
  Dim thirdWord As String
  Dim LastRow1 As Long
  Dim LastRow2 As Long
  Dim LastRow3 As Long
  
  On Error GoTo Whoa
  
  Set ws = Sheet1
  
  firstWord = InputBox(&quot;Enter word for bullet_points&quot;, &quot;Keyword BOX&quot;)
  secondWord = InputBox(&quot;Enter word for item_name&quot;, &quot;Keyword BOX&quot;)
  thirdWord = InputBox(&quot;Enter word for product_description&quot;, &quot;Keyword BOX&quot;)
  LastRow1 = Cells(Rows.Count, 8).End(xlUp).Row + 1
  
  If firstWord = &quot;&quot; Then
      ActiveSheet.Cells(LastRow1, 8).Value = &quot;No INPUT&quot;
  Else
      ActiveSheet.Cells(LastRow1, 8).Value = firstWord
  End If
  
  LastRow2 = Cells(Rows.Count, 9).End(xlUp).Row + 1
  If secondWord = &quot;&quot; Then
      ActiveSheet.Cells(LastRow2, 9).Value = &quot;No INPUT&quot;
  Else
      ActiveSheet.Cells(LastRow2, 9).Value = secondWord
  End If
  
  LastRow3 = Cells(Rows.Count, 10).End(xlUp).Row + 1
  If thirdWord = &quot;&quot; Then
      ActiveSheet.Cells(LastRow3, 10).Value = &quot;No INPUT&quot;
  Else
      ActiveSheet.Cells(LastRow3, 10).Value = thirdWord
  End If
  
  With ws
      If firstWord &lt;&gt; &quot;&quot; Then ReplaceText ws.Range(&quot;B17:B4001&quot;), firstWord
      If secondWord &lt;&gt; &quot;&quot; Then ReplaceText ws.Range(&quot;C17:C4001&quot;), secondWord
      If thirdWord &lt;&gt; &quot;&quot; Then ReplaceText ws.Range(&quot;D17:D4001&quot;), thirdWord
  End With
  
  Exit Sub
  
  Whoa:
      msgbox Err.Description
  End Sub
  
  Private Sub ReplaceText(rng As Range, txt As String)
  Dim aCell As Range
  Dim bCell As Range
  Dim rngFound As Range
  
  Set aCell = rng.Find(What:=txt, LookIn:=xlValues, _
                  LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
                  MatchCase:=False, SearchFormat:=False)
  
  If Not aCell Is Nothing Then
      Set bCell = aCell
      Set rngFound = aCell
  
      Do
          Set aCell = rng.FindNext(After:=aCell)
          If Not aCell Is Nothing Then
              If aCell.Address = bCell.Address Then Exit Do
              Set rngFound = Union(rngFound, aCell)
          Else
              Exit Do
          End If
      Loop
  End If
  
  If Not rngFound Is Nothing Then
      rngFound.Value = &quot;XXXXXXXXXXXXX&quot;
  End If
  </code></pre>