Results 1 to 10 of 10

Doing an audit trail on multiple sheets

Threaded View

  1. #1
    Registered User
    Join Date
    07-08-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    53

    Doing an audit trail on multiple sheets

    Hi all, I found the perfect macro that does an audit trail which reflects the username, the cells that has been changed and what are the changes made. However, when i added in more worksheets to the workbook, the audit trail does not apply to the rest. \

    Currently it only works on Sheet 1. I have a feeling that the changes to the code is only a minor amendment but can anyone take a look and let me know what i should add on or amend? Here's the codes for your reference. Thanks in advance.

    Dim PreviousValue
    
    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Value <> PreviousValue Then
            Sheets("log").Cells(65000, 1).End(xlUp).Offset(1, 0).Value = _
                Application.UserName & " changed cell " & Target.Address _
                & " from " & PreviousValue & " to " & Target.Value
        End If
    End Sub
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        PreviousValue = Target.Value
    End Sub
    Last edited by Nett; 05-31-2010 at 02:43 AM.

Thread Information

Users Browsing this Thread

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

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