title: Object variable not set error
body: <p>I'm an average VBA user and can't figure out why I'm getting an error. </p>
  
  <p>Here is the code:</p>
  
  <pre><code>    Set cell = AA.Sheets(sc).Columns("E").Find(Name, LookAt:=xlWhole)
  If Not cell Is Nothing Then
      FirstAddress = cell.Address
      Do
          s = Application.WorksheetFunction.Match(AA.Sheets(av).Rows(3).Find(AA.Sheets(sc).Range("F" &amp; cell.Row)), AA.Sheets(av).Range("A3:NC3"), 0)
          p = Application.WorksheetFunction.Match(AA.Sheets(av).Rows(3).Find(AA.Sheets(sc).Range("G" &amp; cell.Row)), AA.Sheets(av).Range("A3:NC3"), 0)
          Set cell = AA.Sheets(sc).Columns("E").FindNext(cell)
      Loop While cell.Address &lt;&gt; FirstAddress 'ERROR ON THIS LINE
  End If
  Set cell = Nothing
  </code></pre>
  
  <p>I am getting an object variable or With block variable not set error. after the first run trough, 'cell' is returning 'Nothing' even though there should be 2 more passes. If I remove the 's =' and 'p =' lines, it finishes correctly. I need those for what I'm doing though.</p>
  
  <p>How would I go about fixing this? Thanks!</p>