Hi,
I'm getting a "Run-time error 1004 : Application-defined or object-defined error" when trying to use variables in a R1C1 formula.
This works fine
Sheets(1).Cells(3, 1).FormulaR1C1 = "=SUM(R[-2]C:R[-1]C)"
but this generates an error
Dim i as integer
Dim j as integer
i = -2
j = -1
Sheets(1).Cells(3, 1).FormulaR1C1 = "=SUM(R[i]C:R[j]C)"
Is it not possible to use variables here ? If so, are there any workarounds ? I would like VBA to generate an actual formula in the cell and not the result.
Thanks,
amphi
Bookmarks