Hi
I'm trying to alter the below code but I'm stuck.
On the penultimate line where it pastes all to wb2, how could I change the code so that it only pastes columns B to K. I'm guessing I would need another line just before it to copy only those columns?
I'm trying to alter the below code but I'm stuck.
On the penultimate line where it pastes all to wb2, how could I change the code so that it only pastes columns B to K. I'm guessing I would need another line just before it to copy only those columns?
VBA Code:
lrw = ws.Range("A" & Rows.Count).End(xlUp).Row
lrw2 = ws.Range("B" & Rows.Count).End(xlUp).Row
If lrw > 2 Then
lc = ws.Cells(1, Columns.Count).End(xlToLeft).Column
lr = wb.Range("A" & Rows.Count).End(xlUp).Row + 1
lr2 = wb2.Range("A" & Rows.Count).End(xlUp).Row + 1
ws.Rows("3:" & lrw).Copy
wb.Range("A" & lr).PasteSpecial xlPasteAll
wb2.Range("A" & lr2).PasteSpecial xlPasteAll
ws.Range(ws.Cells(3, 1), ws.Cells(lrw, lc)).EntireRow.ClearContents
End If