Results 1 to 2 of 2
2007-06-05, 13:02 #1
- Join Date
- Mar 2007
- Montreal, Quebec
- Thanked 0 Times in 0 Posts
Formatting dates in footer (Windows, Excel XP)
I inserted a date in a footer. How can I format it to MM DD YYY.
Montreal (Quebec) CANADA
2007-06-05, 13:12 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
Re: Formatting dates in footer (Windows, Excel XP)
The &<!t>[Date]<!/t> code you can insert into a custom header or footer always uses the Short Date format set in the Regional Settings control panel in Windows. If you want a different format, you can do it as follows:
- Press Alt+F11 to activate the Visual Basic Editor.
- Double-click ThisWorkbook in the tree view pane on the left hand side.
- Enter or paste the following code into the module that appears:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftFooter = Format(Date, "mm dd yyyy")
You can use CenterFooter or RightFooter instead of LeftFooter depending on where you want the date, and you can modify the format string "mm dd yyyy" to suit your preference.
The code will be executed automatically each time the workbook is printed.
Note: users will have to enable macros.