如何使用工作表更改事件自动化求解器?
我正在研究基于 S 形曲线的销售预测模型。作为模型的一部分,我希望使用投影和历史数据之间的差平方和 (SUM) 将曲线拟合到可用的历史数据。曲线的唯一变量是其陡度,我使用求解器来求解 SUM 的最小值。
我希望允许用户在历史数据(以绿色突出显示)可用后对其进行更新,从而使该模型更加动态。但是,是否可以通过集成 VBA 的工作表更改事件来自动执行此操作,而不是每次更新历史数据时都需要运行求解器?我对 VBA 很陌生,所以我不太确定如何将像 Solver 这样的函数包含到事件中。
附件是模型的屏幕截图和求解器的参数:
https://i.sstatic.net/bnO0L。 jpg
https://i.sstatic.net/B4zeq.jpg
感谢提前寻求帮助!
I am working on a sales projection model based on a sigmoid curve. As part of the model, I hope to fit the curve to available historical data, using the sum of squared differences (SUM) between the projection and the historical. The only variable for the curve is its steepness, which I am using Solver to solve for the minimum of SUM.
I hope to make this model more dynamic by allowing users to update the historical figures (highlighted in green) once they become available. But instead of needing to run Solver every time the historical figures are updated, is it possible to automate this by integrating a Worksheet Change event for VBA? I am quite new to VBA, so I'm not too sure how to include a function like Solver into the event.
Attached are screenshots of the model and the parameters for Solver:
https://i.sstatic.net/bnO0L.jpg
https://i.sstatic.net/B4zeq.jpg
Thanks in advance for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论