I'm new to this; hopefully someone may be able to help. I have a spreadsheet
were I want to track cells that change. So, when any value within A2:A10 or
B2:B10 changes, I would like to put an "x" within the applicable row in
Column F. I've been able to find a solution to part of my issue by searching
through other questions and answers and have been able to alter the code so
that it works with values that are user-entered, A2:A10. Unfortunately
though, I've been unsuccessful when referring to cells containing formulas,
B2:B10. I've added some sample code below. In this example, values in Range
B2:B10 are populated from values within
another worksheet contained within the same workbook. Any help is much
appreciated.
Thanks, Mike
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A2:A10"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 5).ClearContents
Else
With .Offset(0, 5)
.Value = "x"
End With
End If
Application.EnableEvents = True
End If
End With
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("B2:B10"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 4).ClearContents
Else
With .Offset(0, 4)
.Value = "x"
End With
End If
Application.EnableEvents = True
End If
End With
End Sub
Bookmarks