I get stuck in selecting to always copy the last row with selected cells only (not the whole row). I tried to record a macro, but then it won't copy the last row with selected cells because the code is locating to particular cells.
I have column A-Z in sheet A, and I would like to copy column A:E, R:T, Y:Z, and only copy the last row for each time. Here is the code I have tried. Which part I can change?
Worksheets("A").Select
Range("A2").Select
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 10
Range("A16:E16,R16:T16,Y16:Z16").Select
Range("Y16").Activate
Selection.Copy
Worksheets("B").Activate
R = Worksheets("B").Range("A" & Rows.Count).End(xlUp).Row
Worksheets("B").Range("A" & R + 1).Select
ActiveSheet.PasteSpecial