Results 1 to 3 of 3

Track Changes in excel file

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-18-2017
    Location
    india
    MS-Off Ver
    2010
    Posts
    490

    Track Changes in excel file

    I have got this code online which tracks changes made in a excel file.
    Here is the http://www.exceltrainingvideos.com/t...heet-with-vba/ of it.


    Here is the code
    Dim oldValue As String
    Dim oldAddress As String
    Private Sub Workbook_Open()
    Sheets(“LogDetails”).Visible = xlSheetVeryHidden
    End Sub
    
    Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
    On Error Resume Next
    If Sheets(“LogDetails”).Visible = xlSheetVisible Then
    Sheets(“LogDetails”).Visible = xlSheetVeryHidden
    Else
    Sheets(“LogDetails”).Visible = xlSheetVisible
    End If
    Target.Offset(1, 1).Select
    End Sub
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    Dim sSheetName As String
    sSheetName = “Data”
    If ActiveSheet.Name <> “LogDetails” Then
    Application.EnableEvents = False
    Sheets(“LogDetails”).Range(“A” & Rows.Count).End(xlUp).Offset(1, 0).Value = ActiveSheet.Name & ” – ” & Target.Address(0, 0)
    Sheets(“LogDetails”).Range(“A” & Rows.Count).End(xlUp).Offset(0, 1).Value = oldValue
    Sheets(“LogDetails”).Range(“A” & Rows.Count).End(xlUp).Offset(0, 2).Value = Target.Value
    Sheets(“LogDetails”).Range(“A” & Rows.Count).End(xlUp).Offset(0, 3).Value = Environ(“username”)
    Sheets(“LogDetails”).Range(“A” & Rows.Count).End(xlUp).Offset(0, 4).Value = Now
    Sheets(“LogDetails”).Hyperlinks.Add Anchor:=Sheets(“LogDetails”).Range(“A” & Rows.Count).End(xlUp).Offset(0, 5), Address:=””, SubAddress:=”‘” & sSheetName & “‘!” & oldAddress, TextToDisplay:=oldAddress
    
    Sheets(“LogDetails”).Columns(“A:D”).AutoFit
    Application.EnableEvents = True
    End If
    End Sub
    
    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    oldValue = Target.Value
    oldAddress = Target.Address
    End Sub
    I have attched the file of how the code works (Attchment : Track changes with vba)

    I want to implement the code in my excel file.

    I want to track changes in sheet "PRODUCT"

    How do i edit the code for my purpose?


    Could anyone please help me?


    I have attched my sample file (Attchment - test)
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. track users who open excel file
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-18-2023, 04:01 AM
  2. How track the change history of a Excel file?
    By woshichuanqilz in forum Excel General
    Replies: 1
    Last Post: 04-17-2017, 01:58 AM
  3. Track users who open excel file (new)
    By Logasai in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2016, 10:32 AM
  4. Track changes history in a shared excel file
    By megtoma in forum Excel General
    Replies: 3
    Last Post: 06-04-2014, 09:10 AM
  5. Replies: 1
    Last Post: 05-10-2010, 03:50 PM
  6. [SOLVED] track file proporties
    By Arjan in forum Excel General
    Replies: 4
    Last Post: 07-21-2005, 02:05 PM
  7. [SOLVED] how to track changes from excel file?
    By angie in forum Excel General
    Replies: 1
    Last Post: 06-16-2005, 05:05 PM

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