Hello,

I need help. I am using a built in function within a sub. "LastLineI" and "LastLineInterData" are a variable number within the code.

OutSheet.Range(OutSheet.Cells(1, 4), Cells(LastLineInterData, 7)).FormulaArray = _
"=SplineData(Cells(3,1):cells(LastLineI,2), Cells(1,3):Cells(LastLineInterData,3))"

When I run the code it puts out "#VALUE!" in all the cells. When I record the routine I was able to get another format to use, which works within my code. It is:

OutSheet.Range(OutSheet.Cells(1, 4), Cells(LastLineInterData, 7)).FormulaArray = _
"=SplineData(R[2]C[-3]:R[22]C[-2],RC[-1]:R[300]C[-1])"

But I need to be able to use the variables for my code. I have tried about anything and everything to get it to work. What am I missing?