Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Colin Macleod
 
Posts: n/a
Default Showing date last saved

I want one of the cells on my worksheet to show the date the file was last
saved on - and to update automatically.
What's the best way to do this?
Thanks

Colin

--


  #2   Report Post  
Alan
 
Posts: n/a
Default

You need code to do this,

One way to do it, copy this code into the this 'ThisWorkbook' window in the
VBA editor.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheet1.Range("A1").Value = Date
Sheet1.Range("A2").Value = Time
End Sub

This will put the date saved into A1 and the time saved into A2. To have the
date and time in one cell use

Sheet1.Range("A1").Value = Now

To do this, hit Alt and F11 together to display the VB editor, on the left
of the new window you should see 'This Workbook' Click this to open the
window, copy and paste, hit Alt and F11 again to close the VB editor, save
the file.
Adjust the cell references to suit and format the cells to suit as well,
Regards,
Alan.
"Colin Macleod" wrote in message
...
I want one of the cells on my worksheet to show the date the file was last
saved on - and to update automatically.
What's the best way to do this?
Thanks

Colin

--




  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Colin

Copy/paste this Function to a module in your workbook.

Function DocProps(prop As String)
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

Usage in a cell is: =DOCPROPS("last save time")

Format the cell as Date.

You can also use "last author" or "creation date"

If not familiar with macros and VBA, visit David McRitchie's website on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP


On Mon, 09 May 2005 15:52:05 GMT, "Colin Macleod"
wrote:

I want one of the cells on my worksheet to show the date the file was last
saved on - and to update automatically.
What's the best way to do this?
Thanks

Colin


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I show last date file saved? Pete Excel Worksheet Functions 1 February 17th 05 06:25 PM
How do I insert the date the file was saved in the MS Excel foote. kacate Excel Discussion (Misc queries) 2 January 31st 05 09:11 PM
? on "date last saved" in cell chris w Excel Worksheet Functions 2 January 20th 05 12:51 AM
How do I stop today() from updating date on saved spreadsheets? lionmark Excel Discussion (Misc queries) 2 January 4th 05 01:03 AM
Last saved date into an excel cell Steve J. Vaughan Excel Worksheet Functions 2 December 13th 04 11:17 AM


All times are GMT +1. The time now is 03:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"