|
|
|
|
|
|
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
Columns("A:B").EntireColumn.AutoFit
Range("A1").Select
End Sub
|
How to use:
|
- From Excel go to Tools-Macros-Visual Basic Editor. (ALT+F11)
- In the Project Explorer (CTRL+R), click on the ThisWorkbook object
- Paste the code above into the code pane
- Close the Visual Basic Editor (File-Close)
- Save your file and close it.
|
Test the code:
|
- 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.
|
|