Consulting

Results 1 to 2 of 2

Thread: count the number of changes in several cells

  1. #1

    count the number of changes in several cells

    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.

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    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
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •