Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I set the value of cells to be workbook properties? 1

Status
Not open for further replies.

DPlank

IS-IT--Management
May 30, 2003
1,903
GB
I need to hold the value of the last saved date and the last saved time in the workbook.

But the formulae I am using are :

=today()

and

=now()

The sheet is set to manual calculation so that this only updates on a requested basis. But that hasn't stopped the update happening on the opening of the workbook?
 
OK, Solved it by adding VBA code as follows :

Code:
settime = Time
setdate = Date
ActiveSheet.Range("C4") = setdate
ActiveSheet.Range("E4") = settime
ActiveWorkbook.Save

Yeeha! getting to grips with this stuff after all!

David
 
Hi David
Although you appear to have a solution that fits I thought you may be interested in this. It is possible to read the properties of your workbook. In the case of the last saved time & date you could use this line of code

Code:
ThisWorkbook.BuiltinDocumentProperties("Last Save Time").Value

This could possibly be adapted to a UDF as follows

Code:
Function LastSaved() As Date
LastSaved = ThisWorkbook.BuiltinDocumentProperties("Last Save Time").Value
End Function

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Thanks for the bonus info -- have a star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top