【发布时间】:2019-06-24 05:03:39
【问题描述】:
我一直在尝试使用 Application.WorksheetFunction 从 VBA 代码调用 Forecast.ETS 函数,但是我收到“无法获取工作表函数类错误的 forecast_ets 属性”。
Sub test()
Cells(20, 5) = Application.WorksheetFunction.Forecast_ETS(Cells(5, 3).Value, _
Range(Cells(5, 3), Cells(20, 3)), _
Range(Cells(5, 2), Cells(20, 2)).Value)
End Sub
Cells(5,3).Value 是日期,与Range(Cells(5,2),Cells(20,2)).Value 相同
Range(Cells(5, 3), Cells(20, 3)) 包含历史值。
【问题讨论】:
-
也许尝试删除最后一个
.Value -
在此处检查每个必需的条件:docs.microsoft.com/en-us/office/vba/api/…。有很多指定的。
标签: excel vba forecasting worksheet-function