title: Error 1004: Unable to get the Search property of the WorksheetFunction class
body: <p>I am repeatedly getting error 1004: Unable to get the Search property of the WorksheetFunction class for the code below. Basically, I am trying to ascertain if each cell in a specified range contains a value that meets a criteria - if this criteria is met, then a category should be assigned to the value in another cell in the same worksheet:</p>
  <pre><code>Option Explicit
  
  Sub Lookup_Category()
  
  Dim Cell As Range, Narration As Range
  Dim Counter As Integer
  
  Set Narration = ThisWorkbook.ActiveSheet.Range(&quot;B2:B&quot; &amp; Range(&quot;B&quot; &amp; Rows.Count).End(xlUp).Row)
  
  For Each Cell In Narration
  
      Select Case Cell
              Case Application.WorksheetFunction.Search(&quot;LICIOUS&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;Licious&quot;
              Case Application.WorksheetFunction.Search(&quot;BILLDESK.ELECTRICITY&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;Electricity&quot;
              Case Application.WorksheetFunction.Search(&quot;PLAYSTATIONNETWO&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;PlayStation&quot;
              Case Application.WorksheetFunction.Search(&quot;NEFT CR&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;Inbound Transfers&quot;
              Case Application.WorksheetFunction.Search(&quot;IMPS&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;Inbound Transfers&quot;
              Case Application.WorksheetFunction.Search(&quot;IB FUNDS TRANSFER CR&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;Inbound Transfers&quot;
              Case Application.WorksheetFunction.Search(&quot;IB BILLPAY DR-HDFCYA-463917XXXXXX5057&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;Credit Card Payment&quot;
              Case Application.WorksheetFunction.Search(&quot;POS 416021XXXXXX5159 SWIGGY&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;Dining&quot;
              Case Application.WorksheetFunction.Search(&quot;POS 416021XXXXXX5159 SWIGGY DASH&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;Groceries&quot;
              Case Application.WorksheetFunction.Search(&quot;UPI-VODAFONE IDEA LTD-VILPOSKAR&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;Mobile Bill&quot;
              Case Application.WorksheetFunction.Search(&quot;UPI-SS LIQOURS&quot;, Cell) &gt; 1
                   Cells(Cell.Row, 8) = &quot;Alcohol&quot;
              Case VBA.Left(Cell.Value, 3) = &quot;REV&quot;
                   Cells(Cell.Row, 8) = &quot;Refunds&quot;
              Case Else
                   Cells(Cell.Row, 8) = &quot;&quot;
      End Select
   
  Next Cell
   
  End Sub
  </code></pre>