1
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("z12:z15")
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
If Range("Z12:Z45).value = "yes" then
MsgBox "Cell " & Target.Address & " has changed."
End If
End If
End Sub
我有問題,解決這個問題。任何幫助,將不勝感激。 TXVBA excel,在單元格範圍內運行=「是」的宏
路易吉
您需要檢查「目標」(更改)範圍內的任何單元格是否具有「是」? –
這是正確的。此代碼現在給我錯誤。 –
_Target_是一個範圍...使用'... Application.Intersect(KeyCells,Target)...' – jsotola