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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
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,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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