Hi!
I am very new to Macros and Vba in general so I need some help with a loop i need to do.
I need to copy the range from "U10:X" & LastRow to "Q10:T" & LastRow in a loop until the last column in row 9.
Good to know is that the LastRow will always be the same for every single loop.
In other words I need to copy cell values and replace in four columns before and then delete the original numbers with a step on 8.
My macro right now looks like this but it doesnt not work and is probably way off,
Sub RefreshYear()
Dim xxx As Long
Dim yyy As Long
Dim LastRow As Long
Dim LastCol As Integer
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
With ActiveSheet
LastCol = .Cells(9, .Columns.Count).End(xlToLeft).Column
End With
For x = 21 To LastCol Step 8
y = LastRow
With ActiveSheet
Range(Cells(10, x), Cells(y, 4 + x)).Selection Copy
Range(Cells(10, x - 5), Cells(LastRow, x - 1)).PasteSpecial xlPasteValues
End With
Next x
Would be great if someone could help me around.
Sincerely,
Niclas
Bookmarks