Header and Footer Formatting Codes

by Allen Wyatt
(last updated October 5, 2017)


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. ...


Screen Flip Flop with VBA

Word allows users to conveniently work with multiple documents at the same time. When writing macros, you may need to ...

Discover More

An Automatic File Name

Do you have a set "standard" for how you name new documents? If so, you may be interested in implementing the technique ...

Discover More

Printing a Single Column in Multiple Columns

Ever printed out a worksheet only to find that you have text only at the left side of each page? You can use more of each ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (menu)

Multiple Line Headers and Footers

When working with headers and footers in a macro, you might find this tip helpful. It describes how you can create ...

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

Using a Different Footer on Secondary Pages

When printing a worksheet, you may want to have the footer different on the first page of your document than it is on ...

Discover More

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

View most recent newsletter.


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}] 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 five more than 3?

2017-08-30 16:36:36


I have been try to make the right section of the header in Excel to align to the left of that section. Please help.

2017-02-01 06:14:19

M Humphries

This requires examples. Just putting these codes in do not work

2016-11-21 16:24:35


I am wanting to left align center footer text.

2016-09-25 06:09:45


How Can I Underline My Header In Excel 2007.

2016-09-05 14:33:57

Sandra Smolinsky

I am struggling with changing the alignment in the center header box so that it has left alignment. Thank you.

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

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.