在单元格更改时自动执行Excel宏如何在特定单元格中的值每次更改时自动执行Excel宏?现在,我的工作代码是:Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("H5")) Is Nothing Then MacroEnd Sub哪里"H5"被监控的特定细胞Macro宏的名称。有更好的办法吗?
3 回答
侃侃无极
TA贡献2051条经验 获得超10个赞
Range("H5")
Application.Range("H5")
Application.ActiveSheet.Range("H5")
Target.Worksheet.Range("H5")
:
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Target.Worksheet.Range("H5")) Is Nothing Then MacroEnd Sub
Me.Range("H5")
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Me.Range("H5")) Is Nothing Then MacroEnd Sub
小唯快跑啊
TA贡献1863条经验 获得超2个赞
Dim cell_to_test As Range, cells_changed As Range Set cells_changed = Target(1, 1) Set cell_to_test = Range( RANGE_OF_CELLS_TO_DETECT ) If Not Intersect(cells_changed, cell_to_test) Is Nothing Then Macro End If
添加回答
举报
0/150
提交
取消