Roll your own
From Microsoft support:
The following list contains the format codes that you can use in headers and footers.
Codes to format text ("&" is an ampersand - Shift+7)
(font. Be sure to include the quotation marks around the font name.)
(font size. Use a two-digit number to specify a size in points.)
Codes to insert specific data
- Prints the current date
- Prints the current time
- Prints the name of the document
- Prints the name of the workbook tab (the "sheet name")
- Also prints file name
- Prints path
- Opens dialog box to select graphic (2003)
- Prints the page number
- Prints the page number plus number
- Prints the page number minus number
- Prints a single ampersand
- Prints the total number of pages in the document
In a macro, to use multiple lines in a header, use either of the following methods:
- Use CHR(10) to insert a linefeed character.
- Use CHR(13) to insert a carriage return character.
Also: Daily Dose of Excel: Formatting Footers in VBA
See all Topics