以下代码无效 - 请指导我
Private Sub worksheet_change(ByVal target As Range)
Set target = Range("D11")
If target.value = "Yes" Then
Call main
End If
If target.value = "No" Then
Call Main2
End If
End Sub
答案 0 :(得分:1)
也许你在此之后:
Private Sub Worksheet_Change(ByVal Target as Range)
If Target.Address <> "$D$11" Then Exit Sub ‘ if the changed cell is not $D$11 then do nothing
If Target.Value = "Yes" Then
Main
ElseIf Target.Value = "No" Then
Main2
End If
End Sub