silentcarl
New Member
- Joined
- Feb 29, 2024
- Messages
- 8
- Office Version
- 2010
- Platform
- Windows
I am trying to use a macro to place this formula in cells B3, B9, B(n+6)... until the last row while having the cell references as I need them:
So far I have:
This copies down every 6 rows as I want, but the cell references are the same as the row number. ie A3,A9,A15...
I want them to be sequential ( A2,A3,A4,A5,etc.)
Excel Formula:
=CONCATENATE(RawData!A2," ",RawData!B2)
So far I have:
VBA Code:
Sub test()
Dim UsedRows As Integer
UsedRows = Worksheets("RawData").UsedRange.Rows.Count
Dim i As Long
For i = 3 To UsedRows Step 6
With Cells(i, 2)
.Formula = "=CONCATENATE(RawData!A" & i & "," & " " & ",RawData!B" & i & ")"
End With
Next i
End Sub
This copies down every 6 rows as I want, but the cell references are the same as the row number. ie A3,A9,A15...
I want them to be sequential ( A2,A3,A4,A5,etc.)