Display last saved date for each sheet in workbook

chrisMW

New Member
Joined
Jun 4, 2008
Messages
2
Is there a way to capture the "last saved" date for each tab in a workbook?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
The workbook is saved, and all it's contents, in one go. So, your question doesn't make sense. What about if you kept track of the last updated date for each tab? You could use the Worksheet_Change event to log that somewhere for you.
 
Upvote 0
Thanks, that's helpful....and that is exactly what I'm trying to do: log when changes are made to each respective tab.

The tabs contain site data (each site has their own tab). Updated info/activity comes through regulary, but not at a specific date or time. I'm trying to find a way to track updates because right now the only way we can tell if a site hasn't been sending in their updates is to manually go through and check. There are over a 100 sites, so it's not easy.

I'm an amateur VBE user. Do I use use the event in as a procedure or in a module?

Thanks for your tip.
 
Upvote 0
Insert a sheet named Log, and put "Sheet Name" in cell A1, and "Date changed" in cell B1.

In the VBE, in the Project Explorer window, double click the ThisWorkBook object, which will activate the code window for that object, and insert this:
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    Dim blFound As Boolean
    Application.EnableEvents = False
    blFound = False
    For Each r In Sheets("Log").UsedRange.Rows
        If r.Cells(1, 1) = Sh.Name And r.Cells(1, 2) = Int(Now) Then
            ' already logged today
            blFound = True
            Exit For
        End If
    Next
    If Not blFound Then
        Sheets("Log").Range("A65536").End(xlUp).Offset(1, 0).Value = Sh.Name
        Sheets("Log").Range("A65536").End(xlUp).Offset(0, 1).Value = Int(Now)
    End If
    Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top