D
David
I'm writing variant arrays to Linest with the code below
I'm taking a convoluted route by converting the array elapsedTime()
to a Variant Array 'Xs' via a range 'DeltaT'
I would prefer to use elapsedTime() more directly in Linest?
Any advice will be appreciated
Dim DeltaT as Range, DateTime as Range
Dim elapsedTime(1 to 5), i as Integer
Dim Xs as variant, Ys as Variant, output as variant
Set DateTime = Range("myrng") ' 5 x 1 range
For i = 1 To 5
elapsedTime(i) = DateTime(i) - DateTime(1)
DeltaT(i) = elapsedTime(i) ' populate temporary range
Next i
Ys = Range("myData").value
Xs = DeltaT.value ' transfer temporary range values to variant array
output = WorksheetFunction.LinEst(Ys, Xs, , 1)
I'm taking a convoluted route by converting the array elapsedTime()
to a Variant Array 'Xs' via a range 'DeltaT'
I would prefer to use elapsedTime() more directly in Linest?
Any advice will be appreciated
Dim DeltaT as Range, DateTime as Range
Dim elapsedTime(1 to 5), i as Integer
Dim Xs as variant, Ys as Variant, output as variant
Set DateTime = Range("myrng") ' 5 x 1 range
For i = 1 To 5
elapsedTime(i) = DateTime(i) - DateTime(1)
DeltaT(i) = elapsedTime(i) ' populate temporary range
Next i
Ys = Range("myData").value
Xs = DeltaT.value ' transfer temporary range values to variant array
output = WorksheetFunction.LinEst(Ys, Xs, , 1)