Results 1 to 6 of 6

Track multiple changes as a comment in Excel

Threaded View

  1. #1
    Registered User
    Join Date
    05-27-2015
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    4

    Track multiple changes as a comment in Excel

    Hello Everyone,

    I'm trying to capture the last five changes under comments in Excel via VBA code but I been unsuccessful. I noticed an old thread that had a similar request but has no details for who made the change and the date/time associated with the change.
    What I would like is a similar outcome as the code below but I would like to capture the last 5 changes. The code below capture instantaneous changes only. If the same data is captured for the last 5 changes and is not deleted when the file is closed, that would be great.

    Option Explicit
    Public preValue As Variant
    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Count > 1 Then Exit Sub
        Target.ClearComments
        Target.AddComment.Text Text:="Previous Value is " & Chr(10) & preValue & Chr(10) & "Revised " & Chr(10) & Format(Date, "mm-dd-yyyy") & Chr(10) & Format(Time, "hh:mm AM/PM") & Chr(10) & "By " & Environ("UserName")
        Target.Comment.Shape.Height = 70
    End Sub
     
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Target.Count > 1 Then Exit Sub
        If Target = "" Then
            preValue = "a blank"
        Else: preValue = Target.Value
        End If
    End Sub
    Thank you in advance for your help!
    Tomi
    Last edited by tomi85; 06-01-2015 at 04:31 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy contents of multiple comment boxes and paste in a single comment box
    By xxJaRxx in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-14-2014, 12:39 PM
  2. [SOLVED] Track multiple changes as a comment
    By bcs01 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-13-2013, 02:10 AM
  3. Track Cell History in Comment?
    By alex8447 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2011, 09:17 PM
  4. Replies: 1
    Last Post: 05-10-2010, 03:50 PM
  5. Use Excel to track multiple employees daily work schedules
    By HollyTLove in forum Excel General
    Replies: 0
    Last Post: 09-18-2005, 05:05 AM

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