SAVE function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top