当单元格更改时如何运行一些 VBA 代码?

发布于 2024-09-02 00:21:19 字数 246 浏览 2 评论 0原文

我想在单元格中的值发生变化时添加一些 VBA 代码。

我已经尝试过 Worksheet_Change(),如 Contextures 但是,这不起作用:它仅在用户更改值时触发。我想在值发生变化时触发它,即电子表格重新计算时。

有什么想法吗?

I want to add some VBA code when the value in a cell changes.

I've already tried Worksheet_Change() as described at Contextures however, this won't work: it only fires when the user changes the value. I want to fire it whenever the value changes, i.e. whenever the spreadsheet recalculates.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮年慕年 2024-09-09 00:21:19
Private Sub Worksheet_Calculate()
   MsgBox "Something recalculated", vbOKOnly, "Testing Actions"

End Sub
Private Sub Worksheet_Calculate()
   MsgBox "Something recalculated", vbOKOnly, "Testing Actions"

End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文