Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Moving Part of a Footer Down a Line.
by Allen Wyatt
(last updated February 3, 2020)
Let's say that you have a custom footer that you want at the bottom of all the pages in your worksheet. Left-justified in the footer, you want the full path name for the worksheet, and centered you want a page indicator in the format of Page X of Y.
Because the full path name can be rather long, it is possible that the path will "overprint" the page indicator. This, obviously, is not something you want to do. A better solution would be to push the page indicator down a line, so that it prints on its own line. Toward that end, you try the following:
Figure 1. The Header/Footer tab of the Page Setup dialog box.
When you print your worksheet, you think that the Shift+Enter keystroke (step 5) should move the center section of the footer down by a line. Unfortunately, it does not—Excel ignores the keystroke and places the center section of the footer on the first line, where it is overprinted by the left section of the footer. Drats!
The solution to the problem—without using a macro—is to follow these steps:
&[Path]&[File] &CPage &[Page] of &[Pages]
Notice the inclusion of the &C code at the beginning of the second line in step 5. This tells Excel that everything after it should be centered. The cool thing about doing the footer this way is that Excel, if necessary, will move down a line in order to print the centered information. If it can print the left portion of the footer on the same line as the center portion (the part after &C), then it will do so.
It is interesting to note that in my testing, simply putting a carriage return (Shift+Enter) at the end of whatever is in the Left Section area, and then entering information in the Center Section area still produced an overprint. The only way that this technique worked is if I used the &C code to center the page indicator.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2961) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Moving Part of a Footer Down a Line.
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!
If your workbook is destined for the printed page, you need to be concerned with the layout of that page. Excel allows ...Discover More
Need to copy headers and footers from one worksheet to another? How about from one workbook to another? Here are some ...Discover More
Using a macro to add the full path name into a header or footer in an Excel worksheet.Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.