Automatically update cells with last modified username and date

jasonbowman_

New Member
Joined
Jul 27, 2017
Messages
1
We have a Excel spreadsheet to control and manage our company archive, only certain people have permission to edit and add to the spreadsheet across the company and I'm currently in the process of upgrading this to give us more visibility. I'm after a way to show in cell A2 the date the spreadsheet was last modified and then in cell B2 the username of the last person to modify.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
jasonbowman,

Welcome to the Board.

You might consider the following vba approach...

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Range("A2").Value = Date
    Range("B2").Value = Environ$("Username")
End Sub

The code should be pasted into the "ThisWorkbook" module. Whenever the workbook is saved, the code will put the current date into A2 and the user's name into B2.

Cheers,

tonyyy
 
Upvote 0

Forum statistics

Threads
1,216,105
Messages
6,128,859
Members
449,472
Latest member
ebc9

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