Hi Everyone,
I want to display the date (including time) I last used a certain macro. For example, I want to cell "E3" in "Sheet4" to display when I last used "MacroX". What should I add to MacroX to make this happen? Thanks!
Regards,
Edward
Hi Everyone,
I want to display the date (including time) I last used a certain macro. For example, I want to cell "E3" in "Sheet4" to display when I last used "MacroX". What should I add to MacroX to make this happen? Thanks!
Regards,
Edward
![]()
Please Login or Register to view this content.
Hi Edward
adding the code:
will do it if your working with a single Excel file.![]()
Please Login or Register to view this content.
Otherwise you have to add the Filename:
![]()
Please Login or Register to view this content.
Thanks for the help, I've tried adding the line to a macro, but I keep getting the error:
"Runtime error 9: subscript out of range"
Before adding the following line, the macro worked perfectly:
'Copy date to certain cell in certain sheet to know when was last update
Worksheets("Sheet1").Range("E3").Value = Now()
What am I doing wrong? Thanks!
![]()
Please Login or Register to view this content.
Do you have a sheet named exactly Sheet1?
Not relevant to your immediate problem, but since users can change sheet names, it's preferable to use CodeNames when referencing them from VBA. CodeNames start out the same as sheet names, but diverge when sheets are renamed. (CodeNames of sheets can only be changed via the UI in the VBE.) Then you can use
A reference in this fashion is implicitly to a sheet in the workbook in which the code resides.![]()
Please Login or Register to view this content.
Last edited by shg; 05-10-2008 at 12:20 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks