title: why the control is going to "End Sub" directly?
body: <p>I have used a variable named rng as Range.
  I have found the last row by using:</p>
  
  <pre><code>lastrow = tmpSheet.Cells(tmpSheet.Rows.Count, "A").End(xlUp).Row
  </code></pre>
  
  <p>&amp; after finding a word in a Foundcell(Range format) using:</p>
  
  <pre><code>Set Foundcell = tmpSheet.Range("A2:A" &amp; lastrow).Find(What:="ABC")
  
  Do Until Foundcell Is Nothing
        Set rng = tmpSheet.Range(Cells(1, 1), Cells(lastrow, 1))
         .
         .
          (Copy the row from a aheet to another)
         .
         .
  errHandler:
  
  
  End Sub
  </code></pre>
  
  <p>After getting the value in Foundcell the control goes to End Sub directly from the line <strong>"Set rng"</strong> . I am not getting Why it's happening ?</p>