【问题标题】:Unable to get the forecast_ets property of the worksheetfunction class无法获取 worksheetfunction 类的 forecast_ets 属性
【发布时间】: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)) 包含历史值。

【问题讨论】:

标签: excel vba forecasting worksheet-function


【解决方案1】:

我遇到了同样的问题。当我输入第四个参数时它起作用了,这是周期性的长度(在我的例子中是 12,因为季节性在我的数据中是每年的几个月)。

它应该是可选的,但似乎不是。

【讨论】:

    猜你喜欢
    • 2015-06-14
    • 1970-01-01
    • 2016-10-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    相关资源
    最近更新 更多