View Full Version : Outputting runtime macro to footer of Excel
Marcke
01-05-2009, 08:51 AM
Hi all,
How can I output the time my macro last ran to the left side of my custom footer?
Thanks in advance for the help,
Wannes
Artik
01-05-2009, 09:03 AM
The more details you give, the easier it is to understand your question. Don't save the effort, tell us twice rather than not at all. The amount of info you give strongly influences the quality of answer, and also how fast you get it.
Write what you want to do next.
Artik
Bob Phillips
01-05-2009, 09:08 AM
You would need to declare a public variable, and each time the macro runs update that variable with thetimestamp. You can then use the variab le in your footer with a BeforePrint event.
There is nothing automatic or built-in to tap into.
Marcke
01-05-2009, 09:39 AM
You would need to declare a public variable, and each time the macro runs update that variable with thetimestamp. You can then use the variab le in your footer with a BeforePrint event.
There is nothing automatic or built-in to tap into.
Thanks for the tip. I wil use a global variable. How do I alter only a part of the footer?
Artik
01-05-2009, 09:56 AM
Worksheets("Sheet1").PageSetup.CenterFooter = public_Variable Or LeftFooter, or RightFooter.
Artik
Marcke
01-05-2009, 10:25 AM
Hi,
Thanks for the help.
I have one more question: if i close the excel file, is the value of my global variable then lost? Otherwise I'll store the value in a named range.
Kind Regards,
Wannes
Artik
01-05-2009, 10:36 AM
if i close the excel file, is the value of my global variable then lost? Yes, you lose the value of the variable.
Artik
Marcke
01-05-2009, 10:38 AM
How do can I add an Enter in this footer?
lucas
01-05-2009, 11:24 AM
Use CHR(13) to insert a carriage return character
ActiveSheet.PageSetup.CenterHeader = "First line" & Chr(13) & _
"Second line"
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.