Basically, rather that selecting a range from cells I have stored values in an array through the use of a loop. What I would ideally like to do is use these arrays as the kn
Yes, it can be done. The code snippet below should help get you started:
Dim x() As Variant
ReDim x(1 To 3)
x(1) = 1
x(2) = 2
x(3) = 3
Dim y() As Variant
ReDim y(1 To 3)
y(1) = 4
y(2) = 5
y(3) = 6
Dim z() As Variant
z = WorksheetFunction.LinEst(x, y)
The function returns a Variant
which "boxes" an array of Variant
(which will be either one- or two-dimensional). The other two parameters (not shown above) are either True or False. The function is otherwise detailed in the Excel Help.