Hello
I have the following macro running within Excel:
I can't quite work out why data is being populated the way it is.
Cells(rowReference, 3) = "=budget!R[" & budgetCodeCounter + 4 & "]C1" populates using incremental rows (row 7 through to row 57)
This should have 12 instances of the first cell followed by 12 of the next etc
Cells(rowReference, 2) = "=TEXT(budget!R4C[" & columnCounter - 1 & "], ""dd/mm/yyyy"")" uses -1
yet Cells(rowReference, 4) = "=budget!R5C[" & columnCounter - 3 & "]" uses -3 to get the same columns on a different row
Is it using some sort of offset?
How does this work?
Thanks
Damian.
I have the following macro running within Excel:
Code:
Dim rowReference As Integer
Dim columnCounter As Integer
Dim budgetCodeCounter As Integer
rowReference = 2
For budgetCodeCounter = 1 To 4
For columnCounter = 1 To 12
Cells(rowReference, 1) = "=budget!R1C2"
Cells(rowReference, 2) = "=TEXT(budget!R4C" & columnCounter - 1 & "], ""dd/mm/yyyy"")"
Cells(rowReference, 3) = "=budget!R[" & budgetCodeCounter + 4 & "]C1"
Cells(rowReference, 4) = "=budget!R5C[" & columnCounter - 3 & "]"
rowReference = rowReference + 1
Next columnCounter
Next budgetCodeCounter
Cells(rowReference, 3) = "=budget!R[" & budgetCodeCounter + 4 & "]C1" populates using incremental rows (row 7 through to row 57)
This should have 12 instances of the first cell followed by 12 of the next etc
Cells(rowReference, 2) = "=TEXT(budget!R4C[" & columnCounter - 1 & "], ""dd/mm/yyyy"")" uses -1
yet Cells(rowReference, 4) = "=budget!R5C[" & columnCounter - 3 & "]" uses -3 to get the same columns on a different row
Is it using some sort of offset?
How does this work?
Thanks
Damian.