如果特定范围的外部链接更改,请调用宏

发布于 2025-01-30 03:14:05 字数 522 浏览 4 评论 0原文

由于外部链接,我偶尔会在工作表中更新信息。当该特定行(最后一行)具有计算更改时,我需要将表中的最后一行复制到另一个表。

我使用Worksheet_calculate进行扫描,看看整个表格中是否有任何计算更改,但需要指定范围。代码如下所示,

Private Sub Worksheet_Calculate(ByVal target As Range)
    Dim rWatchRange As Range
    Set rWatchRange = Range("A10:K10")
        If Not Application.Intersect(target, rWatchRange) Is Nothing Then
            Call Update
        End If
End Sub

我会收到编译错误:过程声明与具有相同名称的事件或过程的描述不匹配。

私有子工作表_CALCULATE(BYVAL目标作为范围)

有人可以帮助我向我解释如何解决此问题?

I have information updating to a table in my sheet occasionally due to external links. I need to copy the last line in my table over to another table when that specific row (the last row) has a calculation change.

I use the Worksheet_Calculate to scan and see if there was any calculation change within the whole sheet, but need to specify range. The code is shown below

Private Sub Worksheet_Calculate(ByVal target As Range)
    Dim rWatchRange As Range
    Set rWatchRange = Range("A10:K10")
        If Not Application.Intersect(target, rWatchRange) Is Nothing Then
            Call Update
        End If
End Sub

I'm getting a Compile Error: Procedure declaration does not match description of event or procedure having the same name.

Private Sub Worksheet_Calculate(ByVal target As Range)

Could someone please help explain to me how to fix this issue?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文