title: Copy Paste VBA Code Has Blank Rows
body: <p>The below code searches, copies &amp; pastes the found data into another worksheet. However, there are blanks when this is done in the pasted worksheet. Eg: Found "To Be Copied" in Cell A1 and copied the entire row to the specified worksheet. Found "To Be Copied" in A4 and copied the entire row to the specified worksheet. However, there are two blank rows in the pasted sheet between A1 and A4. Thanks for your help.</p>
  
  <pre><code>Sub Deleting()
      Application.ScreenUpdating = False
      Dim wsh As Worksheet, i As Long, Endr As Long, x1 As Worksheet, p As Long
      Set wsh = ActiveSheet
      Worksheets.Add(Before:=Worksheets("Original Sheet")).Name = "Skipped"
      Set x1 = Worksheets("Skipped")
      Worksheets("ABC").Activate
      i = 2
      Endr = wsh.Range("A" &amp; wsh.Rows.Count).End(xlUp).Row
      While i &lt;= Endr
          If Cells(i, "A") = "To Be Copied" Then
              wsh.Rows(i).Copy
              x1.Rows(i).PasteSpecial
              p = p + 1
              Endr = Endr + 1
          End If
          i = i + 1
      Wend
  End Sub
  </code></pre>