Luis Fiore recently asked how to go about creating a timestamp for a worksheet that would automatically be created whenever a user saves that Excel file. You can accomplish this using Visual Basic for Applications (VBA). To do so, open the workbook you want to add the timestamp to and press [Alt][F11] to open the Visual Basic Editor (VBE). Then, double-click on ThisWorkbook in the Project Explorer.

Select Workbook from the Object dropdown list and then select BeforeSave from the Procedure dropdown list. At the insertion point, enter:

ActiveSheet.PageSetup.RightHeader = Now

Finally, save the module and close the VBE. From now on, each time a user saves the workbook, the current date and time is entered in the current worksheet's right header.

Created Date: 12/11/2001  Last Reviewed: 12/11/2001  Rev. Date: