SAVE function

I

itsme

Can you put a date on the sheet and only have it change automatically if the
file is saved? if so please indicate exactly how.

thanks
 
F

Frank Kabel

Hi
use the following UDF (only on workbook level):

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

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

for more about UDFs see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
P

papou

Yes this can be done using VBA and the workbook_beforesave event:
Right-click on the Excel icon (situated immediately on the left of the File
Menu), choose View Code and paste and amend accordingly the following code :
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Worksheets("Feuil1").Range("A10").Value = Now
End Sub

This will put the date and time in A10 of sheet "Feuil1" each time a save
operation has been called from the workbook.
HTH
Cordially
Pascal
 
Top