ник: Анатолий (Киев)
Вот нашел пример в инете (по слову "WorksheetFunction.Trend" можно нагуглить немеряно) :-)
Function Trend()
Dim objExcel As Excel.Application
Dim Arg1(10) As Double
Dim Arg2(10) As Double
Dim constarg As Double
Dim x As Integer
Dim result As Variant
constarg = Log(10)
For x = 1 To 10
Arg1(x) = x * 100
Arg2(x) = Log(x)
Next
Set objExcel = CreateObject("Excel.Application")
result = objExcel.WorksheetFunction.Trend(Arg1, Arg2, constarg)
MsgBox result(1)
objExcel.Quit
Set objExcel = Nothing
End Function
|