Hello,
I have a snippet of code which detects when a cell in a range is changed. I'd like to use it to detect when several cells not in a continuous range on the same sheet are changed...one option would be to define a bunch of ranges and do-while through them all, I guess. here's my starting point. Maybe there's a better way?:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("AK98")
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
MsgBox "Cell " & Target.Address & " has changed."
End If
End Sub
I have a snippet of code which detects when a cell in a range is changed. I'd like to use it to detect when several cells not in a continuous range on the same sheet are changed...one option would be to define a bunch of ranges and do-while through them all, I guess. here's my starting point. Maybe there's a better way?:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("AK98")
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
MsgBox "Cell " & Target.Address & " has changed."
End If
End Sub