OR
Code:
Sub Test()
Dim Y
Dim X
Dim Arr1
Dim Arr2
Dim lr As Long
lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
With Application
'Y = .Transpose([a1:a10])
'X = .Transpose([b1:b10])
Y = .Transpose(Range("A1:A" & lr).Value)
X = .Transpose(Range("B1:B" & lr).Value)
Arr1 = .Power(.Transpose(X), Array(1, 2, 3))
Arr2 = .LinEst(Y, .Transpose(Arr1))
End With
MsgBox "coefficients are " & Chr(10) & Join(Arr2, Chr(10))
End Sub