I'm getting a Run-Time error '1004' "Paste method of Worksheet class failed" After the paste was completed. if I enter press Debug and move the pointer to the next line of the macro everything works fine,(until the loop comes back to the paste line" This is the code block:
Set r1 = Range(Cells(2, col1), Cells(Range("C" & Rows.Count).End(xlUp).Row, col6))
Set r2 = Range(Cells(2, col7), Cells(Range("C" & Rows.Count).End(xlUp).Row, col9))
Union(r1, r2).Select
Selection.Copy
Sheets(Sheets.Count).Select
Range("B" & lastrow + 1).Select
ActiveSheet.Paste
Application.CutCopyMode = False
After I've bypassed the line, to get past the error, for as many iterations as the loop requires, the macro completes, the sheet looks fine and contains no error.
If I manually perform the cut-and-paste, I get no errors.
I've run out of ideas. Any help would be appreciated