Written by Allen Wyatt (last updated August 7, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
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.
Figure 2. The Footer dialog box.
When you print your worksheet, you think that the Shift+Enter keystroke (step 6) 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 6. 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 (9778) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Moving Part of a Footer Down a Line.
Best-Selling VBA Tutorial for Beginners Take your Excel knowledge to the next level. With a little background in VBA programming, you can go well beyond basic spreadsheets and functions. Use macros to reduce errors, save time, and integrate with other Microsoft applications. Fully updated for the latest version of Office 365. Check out Microsoft 365 Excel VBA Programming For Dummies today!
Excel won't let you place a formula directly into a footer. You can, however, create a simple macro that will produce the ...
Discover MoreDo you want to change the headers and footers that appear on different pages of your printout? Here's how you can get ...
Discover MoreAdd an ampersand to the text in a header or footer and you may be surprised that the ampersand disappears on your ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2019-12-28 16:11:50
John Mann
I forgot one thing I meant to include.
Where can I fin information about that code "&c" to centre an item, and are there more similar codes. I didn't find anything dong a quick look through the Help files
2019-12-28 16:07:27
John Mann
That was interesting, and I have another method as a result of experimenting. I had wondered whether putting a non-printing character in from of the linde feed in the centre section of the footer laout would move the page number down. Didn't work. I then wondered about some dummy text before the line feedwhich could then be formated to the same colour as the paper (and hence invisible), but before changing the font colour I left it visiable and noticed that the text whicy was to become dummy was easily read, while the page number had overwritten the file path and name - the line feed had affected the left hand box of the footer dialogue.
So, put the page number information on the first line, in the centre box, followed by a line feed. No need for invisble dummy text (though a space will work), and the file path and name will be printed on the line below, on the 2nd line.
I tested using Excel 2010 in Windows 10. Most of the test were done using the print preview provided by Excel, but the final version was actually printed.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments