A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

SAVE function



 
 
Thread Tools Display Modes
  #1  
Old September 3rd, 2004, 02:13 PM
itsme
external usenet poster
 
Posts: n/a
Default SAVE function

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
  #2  
Old September 3rd, 2004, 02:22 PM
Frank Kabel
external usenet poster
 
Posts: n/a
Default

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

--
Regards
Frank Kabel
Frankfurt, Germany


itsme wrote:
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


  #3  
Old September 3rd, 2004, 02:23 PM
papou
external usenet poster
 
Posts: n/a
Default

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

"itsme" a écrit dans le message de
...
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
UK postcode issue Lapchien Running & Setting Up Queries 6 June 11th, 2004 09:06 PM
WEEKNUM function david p Worksheet Functions 8 March 13th, 2004 03:24 PM
Function not evaluated Srinivas Chundi Worksheet Functions 1 January 31st, 2004 07:37 PM


All times are GMT +1. The time now is 12:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.