display last date document saved

G

Guest

You can attach a macro to enter the date/time when the workbook is saved.
From the menu bar, Tools > Macro > Visual Basic Editor. Then View > Project
Explorer to bring up the project window, probably on the top-left of your
screen. DOuble-click on the Excel icon labeled 'This Workbook'. Then in the
code window, use the first drop-down to select Workbook, and the second to
select BeforeSave.
VBA will create the subroutine template; you just need to fill in the body.
The sub should look like:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Worksheets("Sheet1").Activate
Range("A1") = Now()
End Sub

You can change 'Sheet1' and 'A1' to suit your needs. Note that this won't
work unless macros are enabled (which in turn requires that security -- Tools
Macros > Security -- is not set to high).
HTH. --Bruce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top