I am creating a formula via vba and .FormulaR1C1
but Excel does not seem to realize it is a formula. It shows the correct formula within the formula bar and a Reference Error in the cell itself.
I tried a test sheet with a simple formula
.Cells(i, recalcCol).FormulaR1C1 = "=RC(-1)"
The cell format is set at general. Inserting .NumberFormat = "general"
at any point before or after does not change the behavior. It is definitely not a text cell.
I can enter the cell with double-click or F2
and then hit Enter
and Excel removes the error and displays the correct result. But doing that for all changed cells is not possible.
I also tried recalculating the sheet, but no change there either.
Any hints?
Thx Kaz
"=RC[-1]"
square brackets – Slai