![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 8
|
Is there an excel function that will return the latest date the file was saved in the contents of a cell?
|
|
|
|
|
|
#2 | |
|
Board Regular
Join Date: Apr 2002
Posts: 112
|
Quote:
Range("A1").Value = FileDateTime("The file name") where "The file name" is the name of the file you ar working on. Note that the file has to be saved at least one time before doing this or else it will cause an error. |
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
(couldn't see anything in any of the functions)
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: North Alabama, USA
Posts: 105
|
Hi,
Well not directly that I am aware of, but just a one line of VBA and you are in business. Code:
Function LastSaveTime() As Date
LastSaveTime = ActiveWorkbook.BuiltinDocumentProperties.Item("Last Save Time")
End Function
_________________ Hope this helps! Rocky "Be not the first by whom the New are try'd, Nor yet the last to lay the Old aside." Alexander Pope (1688-1744). [ This Message was edited by: Rocky E on 2002-05-17 11:44 ] [ This Message was edited by: Rocky E on 2002-05-17 11:46 ] |
|
|
|
|
|
#5 |
|
New Member
Join Date: May 2002
Posts: 8
|
Thanks. That works great the first time I enter the function. The problem I have, is that if I save the file at a later point in time, the cell value does not update (even if I click Recalculate Cells). The only way the cell updates to the new date is to select the cell and hit the "enter" key. How can I have this update automatically when the file is saved?
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|