Private Sub Worksheet_Change(ByVal Target As Range)
Dim r1 As Range
Set r1 = Range("A1:B10")
If Intersect(Selection, r1) Is Nothing Then Exit Sub ' how to write this line ?
MsgBox "323"
End Sub
I want the MsgBox only if I manually select and change some cell inside r1, not by running another code which changes this cells.
Try this
In a
Module, declare aPublicvariableIn all you Subs that can change relavent cells set this variable
Test this variable in the
CnageeventUse
Targetrather thanSelection