
Tips.Net > ExcelTips Home > Page Setup > Headers and Footers > Header and Footer Formatting Codes
Summary: Formatting codes to use in Excel headers and footers. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, and Excel 2003.)
In the previous tip you learned about the different command codes you can use to insert data in your headers and footers. There are also a number of formatting command codes you can use. These codes, again, begin with an ampersand:
| Code | Meaning | |
|---|---|---|
| &L | Start left alignment | |
| &C | Start center alignment | |
| &R | Start right alignment | |
| &"fontname" | Change to designated font (quotes are necessary) | |
| &nn | Two-digit font size to use, in points | |
| &B | Bold (toggle on or off) | |
| &I | Italics (toggle on or off) | |
| &U | Underline (toggle on or off) | |
| &E | Double underline (toggle on or off) | |
| &S | Strikethrough (toggle on or off) | |
| &X | Superscript (toggle on or off) | |
| &Y | Subscript (toggle on or off) |
Command codes can be joined together on a line to achieve the desired result. For instance, if you wanted your footer to be a left-aligned, bold, and underlined current date, you would enter &L&B&U&D. You should note that it doesn't matter where you insert this information; the codes override where you enter it. Thus, if these codes were entered in the Center portion of the header or footer, the command codes would still place the date in the left portion, as you directed.
Tip #2057 applies to Microsoft Excel versions: 97 2000 2002 2003
Save Time! ExcelTips has been published weekly since late 1998. Past issues of ExcelTips are available in convenient ExcelTips archives. Have your own enhanced archive of ExcelTips at your fingertips, available to use at any time!
Check out ExcelTips Archives today!
Add power to your purpose with Excel. A comprehensive 500+ page e-book explains everything you need to know about macros. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site