Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default displaying the latest save date -

Hi!

Is it possible to have a cell function that will look like:
a b
1 Sheet Updated: (Latest saved date)

so that the date in B1 is the day of when it was saved last?
its for a data table, so that users know how up to date the information is.

thanks!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default displaying the latest save date -

Hi Derrick

You need to have a macro or a UDF. Try the below UDF

In any cell type the formula
=GetProperties("Last Save Time")

Function GetProperties(strType As String) As String
GetProperties = ThisWorkbook.BuiltinDocumentProperties(strType)
End Function

OR---------attach the code to an event. Set the Security level to low/medium
in (Tools|Macro|Security). From workbook launch VBE using short-key Alt+F11.
From the left treevew double click 'This Workbook ' and paste the below code
in the code panel...Adjust the Sheetname to suit your requirement..

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range('B1').Value = _
ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Derrick" wrote:

Hi!

Is it possible to have a cell function that will look like:
a b
1 Sheet Updated: (Latest saved date)

so that the date in B1 is the day of when it was saved last?
its for a data table, so that users know how up to date the information is.

thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default displaying the latest save date -

One note with the UDF, because it's not dependent on other cells, it won't
recalculate unless forced. This could lead to confusion, as you can save,
close, make changes & save, close, and the formula won't update (XL's "smart
calculation" rules kicking in). To force the formula to recheck last saved
date at least every time file is opened, you could throw in the NOW function,
like so:

=NOW()-NOW()+GetProperties("Last Save Time")
The formula now forces XL to check the save time any time a calculation is
performed. You may need to reset your cell formatting to show date/time.


--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Jacob Skaria" wrote:

Hi Derrick

You need to have a macro or a UDF. Try the below UDF

In any cell type the formula
=GetProperties("Last Save Time")

Function GetProperties(strType As String) As String
GetProperties = ThisWorkbook.BuiltinDocumentProperties(strType)
End Function

OR---------attach the code to an event. Set the Security level to low/medium
in (Tools|Macro|Security). From workbook launch VBE using short-key Alt+F11.
From the left treevew double click 'This Workbook ' and paste the below code
in the code panel...Adjust the Sheetname to suit your requirement..

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range('B1').Value = _
ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Derrick" wrote:

Hi!

Is it possible to have a cell function that will look like:
a b
1 Sheet Updated: (Latest saved date)

so that the date in B1 is the day of when it was saved last?
its for a data table, so that users know how up to date the information is.

thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default displaying the latest save date -

hi

thanks for the input so far. However, im getting a #Name? error, - its not
understanding the GetProperties() function.
just to make sure im doing it right - in XL 2003,
on the tab below for the sheet, click on 'view code'
then paste:
Function GetProperties(strType As String) As String
GetProperties = ThisWorkbook.BuiltinDocumentProperties(strType)
End Function
into the code under 'General' - and a GetProperties should appear to the
right under Declarations...
in my cell, type =Now() - Now() + GetProperties("Last Save Time")

"Luke M" wrote:

One note with the UDF, because it's not dependent on other cells, it won't
recalculate unless forced. This could lead to confusion, as you can save,
close, make changes & save, close, and the formula won't update (XL's "smart
calculation" rules kicking in). To force the formula to recheck last saved
date at least every time file is opened, you could throw in the NOW function,
like so:

=NOW()-NOW()+GetProperties("Last Save Time")
The formula now forces XL to check the save time any time a calculation is
performed. You may need to reset your cell formatting to show date/time.


--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Jacob Skaria" wrote:

Hi Derrick

You need to have a macro or a UDF. Try the below UDF

In any cell type the formula
=GetProperties("Last Save Time")

Function GetProperties(strType As String) As String
GetProperties = ThisWorkbook.BuiltinDocumentProperties(strType)
End Function

OR---------attach the code to an event. Set the Security level to low/medium
in (Tools|Macro|Security). From workbook launch VBE using short-key Alt+F11.
From the left treevew double click 'This Workbook ' and paste the below code
in the code panel...Adjust the Sheetname to suit your requirement..

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range('B1').Value = _
ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Derrick" wrote:

Hi!

Is it possible to have a cell function that will look like:
a b
1 Sheet Updated: (Latest saved date)

so that the date in B1 is the day of when it was saved last?
its for a data table, so that users know how up to date the information is.

thanks!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default displaying the latest save date -

After you click on "view code" Press Alt+I, M (Insert - Module).
then paste the code. You are currently pasting into a sheet, needs to be in
a module.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Derrick" wrote:

hi

thanks for the input so far. However, im getting a #Name? error, - its not
understanding the GetProperties() function.
just to make sure im doing it right - in XL 2003,
on the tab below for the sheet, click on 'view code'
then paste:
Function GetProperties(strType As String) As String
GetProperties = ThisWorkbook.BuiltinDocumentProperties(strType)
End Function
into the code under 'General' - and a GetProperties should appear to the
right under Declarations...
in my cell, type =Now() - Now() + GetProperties("Last Save Time")

"Luke M" wrote:

One note with the UDF, because it's not dependent on other cells, it won't
recalculate unless forced. This could lead to confusion, as you can save,
close, make changes & save, close, and the formula won't update (XL's "smart
calculation" rules kicking in). To force the formula to recheck last saved
date at least every time file is opened, you could throw in the NOW function,
like so:

=NOW()-NOW()+GetProperties("Last Save Time")
The formula now forces XL to check the save time any time a calculation is
performed. You may need to reset your cell formatting to show date/time.


--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Jacob Skaria" wrote:

Hi Derrick

You need to have a macro or a UDF. Try the below UDF

In any cell type the formula
=GetProperties("Last Save Time")

Function GetProperties(strType As String) As String
GetProperties = ThisWorkbook.BuiltinDocumentProperties(strType)
End Function

OR---------attach the code to an event. Set the Security level to low/medium
in (Tools|Macro|Security). From workbook launch VBE using short-key Alt+F11.
From the left treevew double click 'This Workbook ' and paste the below code
in the code panel...Adjust the Sheetname to suit your requirement..

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Range('B1').Value = _
ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Derrick" wrote:

Hi!

Is it possible to have a cell function that will look like:
a b
1 Sheet Updated: (Latest saved date)

so that the date in B1 is the day of when it was saved last?
its for a data table, so that users know how up to date the information is.

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
Filter latest date from multiple date entries [email protected] Excel Worksheet Functions 1 July 4th 08 09:40 PM
Excel will not save all the latest data and formatting Mark Tampa Excel Discussion (Misc queries) 1 December 22nd 07 02:35 PM
Make Latest Version of Excel the Save as Default Diggsy Excel Discussion (Misc queries) 4 November 14th 06 09:41 PM
Save funciton no longer working after latest download BigD Excel Discussion (Misc queries) 0 September 28th 06 05:26 AM
Why don't my latest changes get save in my backup lonsar37 Excel Worksheet Functions 2 May 12th 05 08:07 AM


All times are GMT +1. The time now is 02:22 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"