Hey,
I'm stuck with this one, please help. I'm trying to use variable in formula but excel gives Run-time error 1004: Application-defined or object-defined error.
Original and working line in the code was:
Cell.Offset(0, 3).FormulaR1C1 = "=(1-COS((6.28318*RC[-3])/102.3))/2"
Then I tried to replace value 102.3 with variable MaxTime (value defined earlier in code):
Cell.Offset(0, 3).FormulaR1C1 = "=(1-COS((6.28318*RC[-3])/" & MaxTime & "))/2"
Any idea why this doesn't work? Also following line works without problems:
Cell.Offset(0, 3).FormulaR1C1 = "=(1-COS((6.28318*RC[-3])/" & "102.3" & "))/2"
Bookmarks