Archive of Mr Excel Message Board
Now this opens a vba editor that "sits" on top of the
entire workbook. The editor should be the screen on
your right. On this screen there are two drop-down
lists. One should say "General" and the other should
say "Declarations." Change the left one to "Workbook"
and change the right one to "BeforeSave." This will
drop a few lines of code in the editing window. Just
delete those.
Now copy and paste this bit of code.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As
Boolean, Cancel As Boolean)
Range("B1").Value = Format(Now(), "dd-mm-yy hh:mm:ss")
End Sub
This will place the date/time stamp in Cell B1. You
can change that to whatever you want, of course.
Also, you can change the way the date appears. Just
change the format in the code. For instance, if you
want to just have the date and not the time, delete
the hh:mm:ss part.

