View Single Post
 
Old 07-28-2017, 08:25 PM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

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
Reply With Quote