且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用单个单元格值运行vba。

更新时间:2023-02-04 19:41:35

您可以使用Worksheet_Change事件:

You can use the Worksheet_Change event:

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Range("A1"), Target) Is Nothing Then
        Application.EnableEvents = False
        ' Your code here
        ...
        Application.EnableEvents = True
    End If
End Sub