PDA

View Full Version : count the number of changes in several cells



omerkaraozan
04-15-2017, 06:40 AM
I need to count the number of changes in a range cells. I know this seems to be easy but I want to do it for several cells so I could not find a solution. Can anyone help on that?
For example I have an excel file that change needs to be tracked for 4 different range of cells actually 4 different column of cells (H,M,S,V) any change in this 4 different range of cells should be tracked and count individually. For example if H3 and M5 is changed than I need to know and record H3 is changed once and M5 is changed once separately.
Can anyone help me on that? I hope it is clear.
Thanks in advance.

mdmackillop
04-15-2017, 01:05 PM
Something like


Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Column
Case 8 'Column H
Sheet2.Cells(1, 2) = Sheet2.Cells(1, 2) + 1
With Sheet2.Cells(Rows.Count, 1).End(xlUp)(2)
.Value = Target.Address
.Offset(, 1) = Target.Value
End With
End Select
End Sub