Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Filter latest date from multiple date entries | Excel Worksheet Functions | |||
Excel will not save all the latest data and formatting | Excel Discussion (Misc queries) | |||
Make Latest Version of Excel the Save as Default | Excel Discussion (Misc queries) | |||
Save funciton no longer working after latest download | Excel Discussion (Misc queries) | |||
Why don't my latest changes get save in my backup | Excel Worksheet Functions |