I want to normalize some data and want this normalized data to change dynamically when the data changes, that's why I want to put Formula in Cells that reference different Cells. But that's not really relevant to the problem because even the simplest of Formula (shown below) doesn't work.
Public Sub Test()
a = 15
Cells(a, 8).FormulaR1C1Local = "=Z(" & a & ")S7"
End Sub
The Formula in the Cell(15,8) is =$G30
.
I expected the following output: =$G15
.
In many forums where people ask how to put variables in a R1C1Formula
the answer is: [" & a & "]
, but this gives a runtime error 1004, so I tried ()
instead and it doesn't give me any warnings, but the result is not what I expected.