title: Need to slightly tweak this code...need it to find exact match and I'm out of my league
body: <pre><code>Public Function FindCodes(keywords As Range, text As String)
      'FindCodes = "TEST"
  
      Dim codeRows As Collection
      Dim codeString As String
      Set codeRows = New Collection
  
      'Find Codes
      For Each Item In keywords
          Dim keywordArr() As String
          Dim i As Integer
          i = 0
          If Item.Row &lt;&gt; 1 Then 'Ignore first row
              keywordArr() = Split(Item, ",")
              'On Error Resume Next
              On Error GoTo ErrHandler
              For Each s In keywordArr()
                  If InStr(LCase(text), LCase(s)) &lt;&gt; 0 Then
                      codeRows.Add Item.Row, CStr(Item.Row)
                  End If
              Next s
          End If
      Next Item
  
      'Build Codes String
      If codeRows.Count &gt; 0 Then
          Dim codeArr() As String
          'Set codeArr = New Collection
          'Dim i As Integer
          'i = 0
          ReDim codeArr(codeRows.Count)
          For Each s In codeRows
              'codeArr.Add s, CStr(Worksheets("Codes").Range("A" &amp; s).Value)
              codeArr(i) = Worksheets("Codes").Range("A" &amp; s).Value
              'Set i = Worksheets("Codes").Range("B" + s).Value
              i = i + 1
          Next s
      End If
  
      'FindCodes = Join(codeArr, ",")
  
      If UBound(codeArr) &gt; 1 Then
          FindCodes = Join(codeArr, ",")
      ElseIf UBound(codeArr) = 1 Then
          FindCodes = codeArr(0)
      Else
          FindCodes = ""
      End If
  
  ErrHandler:
      If Err.Number = 457 Or Err.Number = 0 Or Err.Number = 20 Then
          'foo = someDefaultValue
          Resume Next
      Else
          'Err.Raise Err.Number
          FindCodes = CVErr(xlErrValue)
      End If
  
  End Function
  
  Sub temp()
      Dim r As Range
      Set r = Worksheets("Codes").Range("B:B")
      MsgBox FindCodes(r, ".")
  End Sub
  </code></pre>