title: VBA Range.find errors (Not xlPart finding & Object variable not set error)
body: <p>I am a VBA beginner trying to re-purpose some code from a helpful contributor, I ran into a some trouble and am hoping you can help me out.</p>
  
  <p>I have strings of comments in one sheet (DATA2) and keywords in another (KEYWORDS). My goal is to search through the comments and assign a category to them if one of the keywords is found.</p>
  
  <p>The code below works as I would like on some values <code>(Data = Eric Keyword = Eric)</code>. However, on other values an "Object variable not set" error is thrown, I assume because the value is not being found <code>(Data=Ericlikespie Keyword = Eric OR Data=Emi No Keyword)</code>.</p>
  
  <p>Any pointers would be helpful. I looked through previous answers but most seemed to be related to a range set issue. I realize that can do all this manually with conditional formatting or with a big index+search formula, but am looking for something better.  </p>
  
  <pre><code>Sub Trail()
  
  'DECS
  Dim ws As Worksheet, Map As Worksheet
  Dim MapRange As range, UpdateRange As range, aCell As range, bCell As range
  On Error GoTo Err
  
  'DEFS
  Set ws = Worksheets("DATA2")
  Set Map = Worksheets("KEYWORDS")
  Set UpdateRange = ws.range("K:K")
  Set MapRange = Map.range("A:A")
  
  'COMPS
  For Each aCell In UpdateRange
      Set bCell = MapRange.Find(What:=aCell, LookIn:=xlValues, _
                  LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
                  MatchCase:=False, SearchFormat:=False)
      If Not bCell Is Nothing Then
          aCell.Offset(0, -1) = bCell.Offset(0, 1)
      End If
  Next
  
  Exit Sub
  Err:
  MsgBox Err.Description
  
  End Sub
  </code></pre>