Excel

Write User Name Stamp on Sheet on Save.

Ease of Use

Easy

Version tested with

2003 

Submitted by:

sheeeng

Description:

This code will stamp the current user name to the active worksheet before save. 

Discussion:

Helps to track who is last user modifying the file. 

Code:

instructions for use

			

Option Explicit Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Range("A7").Value = "Previously Saved By: " Range("B7").Value = Application.UserName 'Stamp the current user name Columns("A:B").EntireColumn.AutoFit Range("A1").Select End Sub

How to use:

  1. From Excel go to Tools-Macros-Visual Basic Editor. (ALT+F11)
  2. In the Project Explorer (CTRL+R), click on the ThisWorkbook object
  3. Paste the code above into the code pane
  4. Close the Visual Basic Editor (File-Close)
  5. Save your file and close it.
 

Test the code:

  1. Save the worksheet to see the user name stamp.
 

Sample File:

User Name Stamp.zip 6.65KB 

Approved by mdmackillop


This entry has been viewed 318 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express