![]() |
Modified Date
Is there a way to put in the date when a user saves a document within the
spreadsheet? So that the next user can see when the spreadsheet was last saved. Thanks, -- D |
-- HTH RP (remove nothere from the email address if mailing direct) "D" wrote in message ... Is there a way to put in the date when a user saves a document within the spreadsheet? So that the next user can see when the spreadsheet was last saved. Thanks, -- D |
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean) worksheets("Sheet1").Range("A1").Value = Format(Date,"dd mmm yyyy") End Sub Put this code in the ThisWorkbook code module. -- HTH RP (remove nothere from the email address if mailing direct) "D" wrote in message ... Is there a way to put in the date when a user saves a document within the spreadsheet? So that the next user can see when the spreadsheet was last saved. Thanks, -- D |
D
User Defined Function, not built-in. 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 In a cell enter........... =DOCPROPS("author") or =DOCPROPS("last save time") Gord Dibben Excel MVP On Thu, 6 Jan 2005 13:25:07 -0800, "D" wrote: Is there a way to put in the date when a user saves a document within the spreadsheet? So that the next user can see when the spreadsheet was last saved. Thanks, |
Hi
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Sheets("Sheet1").Range("A1") = "Workbook last saved on " & _ Format(Now, "mmmm dd yyyy") & " at " & Format(Now, "hh:mm") End Sub -- XL2002 Regards William "D" wrote in message ... | Is there a way to put in the date when a user saves a document within the | spreadsheet? So that the next user can see when the spreadsheet was last | saved. | Thanks, | -- | D |
Works great!
Thanks "William" wrote: Hi Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Sheets("Sheet1").Range("A1") = "Workbook last saved on " & _ Format(Now, "mmmm dd yyyy") & " at " & Format(Now, "hh:mm") End Sub -- XL2002 Regards William "D" wrote in message ... | Is there a way to put in the date when a user saves a document within the | spreadsheet? So that the next user can see when the spreadsheet was last | saved. | Thanks, | -- | D |
Nevermind I got it. You gotta create and insert in a Module.
Duh! Thanks. "Gord Dibben" wrote: D User Defined Function, not built-in. 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 In a cell enter........... =DOCPROPS("author") or =DOCPROPS("last save time") Gord Dibben Excel MVP On Thu, 6 Jan 2005 13:25:07 -0800, "D" wrote: Is there a way to put in the date when a user saves a document within the spreadsheet? So that the next user can see when the spreadsheet was last saved. Thanks, |
Where do I put the code in at? I right-click on the worksheet and go to "View
Code" but when I insert this code into the "ThisWorkbook" When I insert "DOCPROPS("author") it returns a "#Name?" error Should I insert the code in the worksheet instead of "ThisWorkbook" "Gord Dibben" wrote: D User Defined Function, not built-in. 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 In a cell enter........... =DOCPROPS("author") or =DOCPROPS("last save time") Gord Dibben Excel MVP On Thu, 6 Jan 2005 13:25:07 -0800, "D" wrote: Is there a way to put in the date when a user saves a document within the spreadsheet? So that the next user can see when the spreadsheet was last saved. Thanks, |
Modified Date
I get the same error "#Name" - what is the solution for this?
"D" wrote: Where do I put the code in at? I right-click on the worksheet and go to "View Code" but when I insert this code into the "ThisWorkbook" When I insert "DOCPROPS("author") it returns a "#Name?" error Should I insert the code in the worksheet instead of "ThisWorkbook" "Gord Dibben" wrote: D User Defined Function, not built-in. 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 In a cell enter........... =DOCPROPS("author") or =DOCPROPS("last save time") Gord Dibben Excel MVP On Thu, 6 Jan 2005 13:25:07 -0800, "D" wrote: Is there a way to put in the date when a user saves a document within the spreadsheet? So that the next user can see when the spreadsheet was last saved. Thanks, |
Modified Date
Put it in a regular code module: In the Visual Basic Editor, with your
project selected, choose Insert/Module. In article , debbieevans wrote: I get the same error "#Name" - what is the solution for this? "D" wrote: Where do I put the code in at? I right-click on the worksheet and go to "View Code" but when I insert this code into the "ThisWorkbook" When I insert "DOCPROPS("author") it returns a "#Name?" error Should I insert the code in the worksheet instead of "ThisWorkbook" "Gord Dibben" wrote: D User Defined Function, not built-in. 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 In a cell enter........... =DOCPROPS("author") or =DOCPROPS("last save time") Gord Dibben Excel MVP On Thu, 6 Jan 2005 13:25:07 -0800, "D" wrote: Is there a way to put in the date when a user saves a document within the spreadsheet? So that the next user can see when the spreadsheet was last saved. Thanks, |
Modified Date
On the tab I select view code -Do I hilight all the code in the right hand
box? I tried this and then toolbar - insert - module , nothing happened I kept seeing more and more modules appearing. I do not know vba so is it possible to tell me in layman terms? People like me probably drive you mad. I don't understand why Microsoft havent made this available without the vba route........Yours hopefully "JE McGimpsey" wrote: Put it in a regular code module: In the Visual Basic Editor, with your project selected, choose Insert/Module. In article , debbieevans wrote: I get the same error "#Name" - what is the solution for this? "D" wrote: Where do I put the code in at? I right-click on the worksheet and go to "View Code" but when I insert this code into the "ThisWorkbook" When I insert "DOCPROPS("author") it returns a "#Name?" error Should I insert the code in the worksheet instead of "ThisWorkbook" "Gord Dibben" wrote: D User Defined Function, not built-in. 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 In a cell enter........... =DOCPROPS("author") or =DOCPROPS("last save time") Gord Dibben Excel MVP On Thu, 6 Jan 2005 13:25:07 -0800, "D" wrote: Is there a way to put in the date when a user saves a document within the spreadsheet? So that the next user can see when the spreadsheet was last saved. Thanks, |
Modified Date
Perhaps this will help:
http://www.mvps.org/dmcritchie/excel/getstarted.htm In article , debbieevans wrote: On the tab I select view code -Do I hilight all the code in the right hand box? I tried this and then toolbar - insert - module , nothing happened I kept seeing more and more modules appearing. I do not know vba so is it possible to tell me in layman terms? People like me probably drive you mad. I don't understand why Microsoft havent made this available without the vba route........Yours hopefully |
Modified Date
thanks for your patience - do you happen to know where there is an online
training course for advanced excel and vba? "JE McGimpsey" wrote: Perhaps this will help: http://www.mvps.org/dmcritchie/excel/getstarted.htm In article , debbieevans wrote: On the tab I select view code -Do I hilight all the code in the right hand box? I tried this and then toolbar - insert - module , nothing happened I kept seeing more and more modules appearing. I do not know vba so is it possible to tell me in layman terms? People like me probably drive you mad. I don't understand why Microsoft havent made this available without the vba route........Yours hopefully |
All times are GMT +1. The time now is 12:38 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com