The following code was written to delete rows from a workbook completely. The user now wants the deleted rows pasted into another worksheet within the files. I was able to get the data pasted into another worksheet but it left blank rows. I was struggling with a way to delete those rows. I'm sure there is a better way. Here is the original code:

'This section of the code will delete the transfer to debenture, settled and PIF loans
' from the file if the accrual is at zero.

Dim X As Long
Dim Z As Long
Dim LastRow As Long
Dim FoundRowToDelete As Boolean
Dim OriginalCalculationMode As Long
Dim RowsToDelete As Range
Dim SearchItems() As String

Dim DataStartRow As Long
Dim SearchColumn As String
Dim SheetName As String

DataStartRow = 1
SearchColumn = "L"
SheetName = "detail"

SearchItems = Split("Tran to CPN,Settled,PIF", ",")

On Error GoTo Whoops
OriginalCalculationMode = Application.Calculation
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False

With Worksheets(SheetName)
LastRow = .Cells(.Rows.Count, SearchColumn).End(xlUp).Row
For X = LastRow To DataStartRow Step -1
FoundRowToDelete = False
For Z = 0 To UBound(SearchItems)
If InStr(.Cells(X, SearchColumn).Value, SearchItems(Z)) And .Cells(X, "AF").Value = 0 Then
FoundRowToDelete = True
Exit For
End If

Next

If FoundRowToDelete Then
If RowsToDelete Is Nothing Then
Set RowsToDelete = .Cells(X, SearchColumn)
Else
Set RowsToDelete = Union(RowsToDelete, .Cells(X, SearchColumn))
End If

If RowsToDelete.Areas.Count > 100 Then
RowsToDelete.EntireRow.Delete
Set RowsToDelete = Nothing
End If
End If

Next

End With
If Not RowsToDelete Is Nothing Then
RowsToDelete.EntireRow.Delete
End If

Whoops:
Application.Calculation = OriginalCalculationMode
Application.ScreenUpdating = True
Please let me know if you need any additional infomation. Thank you in advance for you help!!

THANKS!
Kelly