Header and Footer Formatting Codes

Written by Allen Wyatt (last updated May 2, 2020)
This tip applies to Excel 97, 2000, 2002, and 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.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2057) applies to Microsoft Excel 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Controlling Display of the Status Bar

The status bar is used to display all sorts of information about the document on which you are working. Depending on your ...

Discover More

Shortcut to Move between Two Worksheets

Moving between to adjacent worksheets is easy; Excel provides a shortcut key to do the trick. If you want to move between ...

Discover More

Excel Refuses to Put Page Breaks between Subtotal Groups

Page breaks not appearing where you expect them in your subtotaled data? It could be because of a setting you made in ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (menu)

Ampersands in Headers and Footers

Add an ampersand to the text in a header or footer and you may be surprised that the ampersand disappears on your ...

Discover More

Deleting a Header

Each new Excel worksheet contains a page header, by default. Follow this tip to get rid of headers you don't need.

Discover More

Specifying Date Formats in Headers

Don't like the default date format used by Excel when you place the date in a header or footer? You can use a macro to ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four minus 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.