Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Date of Last Update Automatically?

Is there any way to have a field that will automatically
display the date of the last update?

We have a calendar online that people are questioning how
often it has been updating, so this would solve any
issues right from the start.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Date of Last Update Automatically?

Hi Crush

If you mean last saved date of the file??

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Sheets("Sheet1").Range("a1").Value = Date
End Sub

Right click on the Excel icon next to File in the menubar
Choose view code
Paste this event there
Alt-q to go back to Excel

If you save the file the date will be placed in A1



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Crush" wrote in message ...
Is there any way to have a field that will automatically
display the date of the last update?

We have a calendar online that people are questioning how
often it has been updating, so this would solve any
issues right from the start.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Date of Last Update Automatically?

You need VBA, but you could use a UDF. Here is an example

Function DocProps(prop As String)

On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties(prop)
Exit Function

err_value:
DocProps = CVErr(xlErrValue)
End Function

Put the function in a standard code module.

and can be used like so

=DocProps("Last save time")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Crush" wrote in message
...
Is there any way to have a field that will automatically
display the date of the last update?

We have a calendar online that people are questioning how
often it has been updating, so this would solve any
issues right from the start.

Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Date of Last Update Automatically?

Hi

ActiveWorkbook.BuiltinDocumentProperties
Is not working correct in Excel 97

Read this from Tom Ogilvy

Note that this property is not maintained in xl97. However, if the workbook
is created/used in both xl97 and later versions, then when used in the
later versions and saved the property is maintained but when used in xl97
and saved, the property is not altered. The time it was last saved in the
later version will be retrieved if this property is called. If created and
used exclusively in xl97, calling this property will raise an error. You
can use the beforesave event to update this property in xl97 as a
workaround. Just test the version of excel and if xl97, update the
property.



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Bob Phillips" wrote in message ...
You need VBA, but you could use a UDF. Here is an example

Function DocProps(prop As String)

On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties(prop)
Exit Function

err_value:
DocProps = CVErr(xlErrValue)
End Function

Put the function in a standard code module.

and can be used like so

=DocProps("Last save time")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Crush" wrote in message
...
Is there any way to have a field that will automatically
display the date of the last update?

We have a calendar online that people are questioning how
often it has been updating, so this would solve any
issues right from the start.

Thanks





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Date of Last Update Automatically?

Cool. Look forward to testing it out tomorrow.
Thanks much.


-----Original Message-----
Hi Crush

If you mean last saved date of the file??

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As

Boolean, _
Cancel As Boolean)
Sheets("Sheet1").Range("a1").Value = Date
End Sub

Right click on the Excel icon next to File in the menubar
Choose view code
Paste this event there
Alt-q to go back to Excel

If you save the file the date will be placed in A1



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Crush" wrote in

message ...
Is there any way to have a field that will

automatically
display the date of the last update?

We have a calendar online that people are questioning

how
often it has been updating, so this would solve any
issues right from the start.

Thanks



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clarification - how to automatically update cells with a date and date range Bekki Excel Discussion (Misc queries) 1 August 31st 10 03:18 AM
automatically update date cc Excel Worksheet Functions 5 April 2nd 09 07:48 PM
Automatically update a cell with a date based on anther cells date GPR GUY Excel Discussion (Misc queries) 2 November 3rd 08 03:57 PM
Update DAte Automatically SilviaG Excel Worksheet Functions 2 June 4th 08 11:18 PM
How do I get the date to automatically update brett Excel Worksheet Functions 1 March 12th 05 04:18 PM


All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"