Your code should work within the same sheet. If you want to count the number of times the cell is changed in an other sheet, say Sheet2
, then you would have to change the code to something like:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:A100")) Is Nothing Then
ActiveWorkbook.Sheets("Sheet2").Cells(Target.Row, 3).Value = ActiveWorkbook.Sheets("Sheet2").Cells(Target.Row, 3).Value + 1
End If
End Sub
This change event only reacts on change to cells in A1:A100
and then changes the count in the corresponding cell in the C row on Sheet2
.