+ Reply to Thread
Results 1 to 2 of 2

Cell Change Record

Hybrid View

  1. #1
    Registered User
    Join Date
    08-21-2010
    Location
    Omaha, NE
    MS-Off Ver
    Excel 2003
    Posts
    45

    Cell Change Record

    Is this possible: whenever the value of a cell changes that value and the time of the change is recorded?

    For instance, if cell A1 begins with a value of 5, then changes to 4, that new value is recorded:

    (4, 10/26/2011 1:42am)
    ...
    and so forth.

    The changes would be as the result of a DDE link; not a user typing into a cell. Thanks for any help!

    Greg

  2. #2
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Cell Change Record

    It can be done, but it's not easy (at least not for me).
    Try this to get you started:

    Sub StartCheckValues(Optional ByVal bStop as Boolean)
        Static dtStarted as Date
        Dim dt as Date
    
        If bStop Then
            Application.OnTime dtStarted, "CheckValues", Schedule:=False
        Else
            dt = Now + TimeValue("00:01:00")
            Application.OnTime dt, "CheckValues"
            dtStarted = dt
        End If
    End Sub
    
    Sub CheckValues()
        Dim r as Range
        With Sheets("Values")
            Set r = .Range("A1")
            Do While r.Value > ""
                If r.Value <> r.Offset(0,1).Value Then
                    r.Offset(0,2).Value = r.offset(0,1).Value & " Changed To " & r.Value & " at "  & now
                    r.Offset(0,1).Value = r.Value
                End If
                Set r = r.Offset(1)
            Loop
        End With
        StartCheckValues
    End Sub
    
    Sub StopCheckValues()
        StartCheckValues True
    End Sub
    Then run "StartCheckValues" to start checking and "StopCheckValues" to stop checking.
    If you want to always be running when the workbook is open then put "StartCheckValues" in Workbook_Open()
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1