Hi All,
I'm new to this blog, so I hope I follow the rules correctly. Thanks for accepting me.
I need help setting up a macro/VBA to copy a specific column (G) range "G1:G550", which contains data in some cells and formulas in the others others. The column needs to be copied to the next 50 columns to every 2nd column, starting from Column I then K then M etc.
I've tried the following code but it does not seem to work:
I would appreciate any help. Please let me know should you require more information.
Thank You
I'm new to this blog, so I hope I follow the rules correctly. Thanks for accepting me.
I need help setting up a macro/VBA to copy a specific column (G) range "G1:G550", which contains data in some cells and formulas in the others others. The column needs to be copied to the next 50 columns to every 2nd column, starting from Column I then K then M etc.
I've tried the following code but it does not seem to work:
Code:
Sub ColCopy()
Dim cpval As Range
Dim lastRow As Long
With Worksheets("Sheet4")
lastRow = .Cells(Rows.Count, "G").End(xlUp).Row
Set cpval = .Range("G550:G" & lastRow)
For colx = 9 To 50 Step 2
.Range(.Cells(550, colx), .Cells(lastRow, colx)).Value = cpval.Value
Next
End With
End Sub
I would appreciate any help. Please let me know should you require more information.
Thank You