I have this code that copies the data from two sheets to one in another workbook. The issue is that it does not copy correctly from the second sheet. It copies only rows 12 and 13 while the range should be row 13 to last row. I am assuming it has to do something with the activecell but have trouble finding it.
Thanks.
I have this code in another file where it copies 20 sheets to one and it works all fine. The only difference is that they are all in the same workbook.
Sub Copy()
For i = 2 To 3
wbk1.Worksheets(i).Activate
LastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row
Range("AV13:CJ" & LastRow).Select
Selection.Copy
wbk.Sheets("Data").Activate
LastRow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Offset(0, -3).Select
Selection.PasteSpecial xlPasteValues
Next i