在单元格更改时自动执行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贡献1866条经验 获得超5个赞
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贡献1843条经验 获得超7个赞
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
- 3 回答
- 0 关注
- 306 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消