I am tracking any changes made in several colums using the following logic
It tracks cell changes in column A and B and places a "1" in column S
It works fine except when I insert a line or copy/insert a line it responds with
"Application-defined or Object-defined error" it highlights "Target.Offset(0, 18).Value = 1"
My guess is that since I do not click in a cell, the "Target" is not defined
Any solution would be helpfull, including simplifying the code since I actually track many non-adjacent columns
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngMonitor As Range
Set rngMonitor = Range("A4:A1000") ' track first name
If Not Intersect(Target, rngMonitor) Is Nothing _
And Target.Address <> rngChange.Address Then Target.Offset(0, 18).Value = 1
Set rngMonitor = Range("B4:B1000") ' track last name
If Not Intersect(Target, rngMonitor) Is Nothing _
And Target.Address <> rngChange.Address Then Target.Offset(0, 17).Value = 1
end sub
It tracks cell changes in column A and B and places a "1" in column S
It works fine except when I insert a line or copy/insert a line it responds with
"Application-defined or Object-defined error" it highlights "Target.Offset(0, 18).Value = 1"
My guess is that since I do not click in a cell, the "Target" is not defined
Any solution would be helpfull, including simplifying the code since I actually track many non-adjacent columns