I loop thorough the sheets successfully until the last sheet where I get the Object Variable error and a Subscript out of range error.
I believe the issue may be in the ActiveSheet.Next.Select when it runs out of worksheets. (see code). I have tried several loop methods using codes from here and other sites with no success. I can't use ThisWorkbook because the loop is being done on another workbook.
Dim WS As Worksheet
For Each WS In Worksheets
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = LastRow To 16 Step -1
If Cells(i, 1) = "Actual:" Or Cells(i, 1) = "" Then
'Delete Rows containing Actual: or empty rows
Rows(i).EntireRow.Delete
End If
Next i
ActiveSheet.Next.Select
Next WS
This completes preparing the workbook to copy the remaining lines, which is in another procedure.