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)
&L
(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
&D
- Prints the current date
- &T
- Prints the current time
- &F
- Prints the name of the document
- &A
- Prints the name of the workbook tab (the "sheet name")
- &[File]
- Also prints file name
- &[Path]
- Prints path
- &[Picture]
- Opens dialog box to select graphic (2003)
- &P
- Prints the page number
- &P+number
- Prints the page number plus number
- &P-number
- Prints the page number minus number
- &&
- Prints a single ampersand
- &N
- 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.
Microsoft KB213618
Also: Daily Dose of Excel: Formatting Footers in VBA
See all Topics
No comments:
Post a Comment