Thread: [Solved] Insert date when save file
View Single Post
 
Old 01-28-2011, 07:00 PM
gg80 gg80 is offline Windows 7 Office 2007
Novice
 
Join Date: Jul 2010
Location: Berkeley, CA
Posts: 9
gg80 is on a distinguished road
Default Insert date when save file

I want to insert the save date in a cell whenever the file is saved. I got this code from google search:

Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range("A1").Value = Format(Now(), "mm-dd-yy")
End Sub

It works great on excel 2003, but not in excel 2007 (running under W7).

I googled to get the above, but found nada about something specific for 2007.

Any help much appreciated
Reply With Quote