当我修改B12
时使用此宏清除B11
时,我收到编译错误:
检测到不明确的名称:Worksheet_Change
你能帮助我吗?
代码:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "B11" Then
Range("B12").ClearContents
End If
End Sub
答案 0 :(得分:0)
试试这个:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B11")) Is Nothing Then
Application.EnableEvents = False
Range("B12").ClearContents
Application.EnableEvents = True
End If
End Sub