Last modified date and user

jessiegeorgia

Board Regular
Joined
Aug 19, 2011
Messages
78
Hi All,

Is there away to auto fill a last modified date and user on a sheet/workbook, I was hoping there would be something equivalent to Word's Quick Parts? Relying on users to enter the date when they make changes isn't proving very reliable nor can I rely on users to check the file/info to make sure they are quoting the correct date when the data is used or shared wider.

Many thanks in advance,
Jess
 
Last edited:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
See if this helps.

In the main module

Code:
Public WbookChanged As Boolean

In each sheet in the workbook
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    WbookChanged = True
End Sub

In Thisworkbook
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
    If WbookChanged = True Then
        'Where A1 is the user name, A2 = date time
        Range("A1").Value = Application.UserName
        Range("A2").Value = Now()
        'If there is a password it will require more below
        Workbook.Save
    End If
End Sub
 
Upvote 0
Opps

Workbook.Save should be This Workbook.save
 
Upvote 0
It should appear in "A1" and "A2" when you re-open the workbook. Just a note, the workbook should have already been saved as an "xlsm" to preserve the macros.

I did a step through to check it was working, starting with the sheetchange routine. When I confirmed that was OK I did the same with the beforeclose.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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