I'm new here.
I'm trying to set the formula of a cell to a given string as below, but am getting a run-time error '1004': Application-defined or object-defined error. The cell is on the active sheet and I can set the formula to blank in the immediate window but I cannot set it to the formula below without hitting the error.
Cells(47, i).Formula = "=('sheetName'!$C$105-SUM(OFFSET($C$47,0,0,1," + _
CStr(i - 3) + ")))/(COLUMN($N$47)-COLUMN(" + _
CStr(i - 1) + "$47))"
I'm wondering if there is some special character restrictions on the string?
COLUMN(" + CStr(i - 1) + "$47))"
because as I seeCStr(i - 1)
will return number – Dmitry Pavliv