Hello,
I am having great difficulty in getting VBA to output a continuous array (through a lastRow command). I have original data sets that vary in length and would like the automation to work its interpolation to the end of row, regardless of range. The user will also be appending data to the original set, thereby appending the array. Eventually the code would allow the array to append the data through screen update so as to not have to continually run the macro. The original code generated via macro:
Iteration #1 (completes the interp array, but both "H" and arrays need to be capable of appending data):
range("H2:H308").Select
Selection.FormulaArray = "=csplinea(R2C1:R308C1,R2C2:R308C2,R2C7:R308C7)"
Interation #2 (does not complete the interp array from R3C7:R):
lastRow = range("A" & Rows.Count).End(xlUp).Row
range("H2:H" & lastRow).FormulaArray = "=csplinea(R2C1:R579C1,R2C2:R579C3,R2C7:R13543C7)"
Iteration #3 (still does not complete the interp array from R3C7:R):
range("H2:H" & lastRow).FormulaArray = "=csplinea(R2C1:R" & lastrow & "C1,R2C2:R" & lastrow & "C3,R2C7:R" & Range("A" & lastrow)-range("A2")+1 &"C7)"
When lastRow is used for the array, the array always stops where "C1:R" stops and doesn't continue with the series of range ("H").
I'm completely stumped. Someone has helped me with the above iterations on Ozgrid up until now but have decided to no longer follow the thread, maybe because it is something I need to possibly hire a programmer to work on. I don't know if I am at that point yet, but any help would be greatly appreciated. I've been scratching my head at this for several weeks now and reading all the online forums for some direction. I have attached the macro wb.
Best regards,
Zach
Bookmarks