![]() |
Automatic Saved Date
This sounds awfully basic, but for the life of me, I can't figure out how to do it. I would like the date at the top of my spreadsheet to reflect the last save date for the file. Isn't there a function that will handle this? -- tommy20 ------------------------------------------------------------------------ tommy20's Profile: http://www.excelforum.com/member.php...fo&userid=2817 View this thread: http://www.excelforum.com/showthread...hreadid=528191 |
Automatic Saved Date
There is no built-in function to do this.
A user designed function (UDF) is necessary. '-------------------- 'Place the following code in the "ThisWorkbook" module... Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Application.OnTime Now, ThisWorkbook.Name & "!TimeSaved" End Sub 'Place the following code in a standard module... Sub TimeSaved() Dim strPath As String strPath = ActiveWorkbook.Path Range("B4").Value = "Last saved: " & FileDateTime(strPath) End Sub '-------------------- Every time the workbook is saved, the saved date and time will appear in Cell B4 on the currently active sheet. Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "tommy20" wrote in message... This sounds awfully basic, but for the life of me, I can't figure out how to do it. I would like the date at the top of my spreadsheet to reflect the last save date for the file. Isn't there a function that will handle this? |
Automatic Saved Date
UDF, eh? Well, that'll sure be unknown territory for me. I'll give it a shot. Thanks! -- tommy20 ------------------------------------------------------------------------ tommy20's Profile: http://www.excelforum.com/member.php...fo&userid=2817 View this thread: http://www.excelforum.com/showthread...hreadid=528191 |
Automatic Saved Date
This could be of assistance...
http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "tommy20"wrote in message ... UDF, eh? Well, that'll sure be unknown territory for me. I'll give it a shot. Thanks! tommy20 |
Automatic Saved Date
The code I gave you has some problems when the
workbook is closed. Also, technically it is not a user designed function. The following code placed in a standard module should do what you want. It will update every time the workbook is recalculated. To use it, in a cell just enter ... = timesaved() Jim Cone '-------------------------- Function TimeSaved() Application.Volatile Dim strPath As String strPath = ActiveWorkbook.Path TimeSaved = "Last saved: " & FileDateTime(strPath) End Function |
All times are GMT +1. The time now is 08:51 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com