Omitting Page Numbers on Some Pages

Written by Allen Wyatt (last updated February 13, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


1

Roger wonders how he can add page numbers to all pages of a worksheet except the first four. He doesn't want to have to split the worksheet into two.

Excel allows you to specify, in the header or footer, page numbers for whatever you print out. However, that is about it—Excel doesn't allow you to specify different headers or footers for different pages, as you can with Word.

So, the solution is to simply perform your printing in two passes. You would set your footer (without page numbers) and then print pages 1-4. Then, modify the footer (remove the page numbers) and print starting with page 5.

Of course, doing this each time you want to print could become tedious. It would be easier to make the changes and do the printing using a macro. Here's one that can do it for you:

Sub SpecialPrint1()
    ActiveSheet.PageSetup.CenterFooter = ""
    ActiveWindow.SelectedSheets.PrintOut From:=1, To:=4

    ActiveSheet.PageSetup.CenterFooter = "Page &P"
    ActiveWindow.SelectedSheets.PrintOut From:=5

    ActiveSheet.PageSetup.CenterFooter = ""
End Sub

This macro essentially automates the manual process already mentioned. There are two print passes done in the macro; you can identify these by the use of the .PrintOut method. The first pass prints pages 1-4 and the second prints from page 5 onward.

Before each print pass, the macro sets the center portion of the footer (using the .CenterFooter property) to whatever is appropriate for that pass. You can change which portion of the header or footer is modified simply by changing the references to the .CenterFooter property to whatever is appropriate: .LeftHeader, .CenterHeader, .RightHeader, .LeftFooter, .CenterFooter, or .RightFooter.

Note that the macro assumes that you want page 5 to have the page number printed as 5. If, instead, you want the page number printed as 1 in the second pass, then you should modify the macro just a bit so that it specifies a different start page number for the second print pass:

Sub SpecialPrint2()
    ActiveSheet.PageSetup.CenterFooter = ""
    ActiveWindow.SelectedSheets.PrintOut From:=1, To:=4

    ActiveSheet.PageSetup.CenterFooter = "Page &P"
    ActiveSheet.PageSetup.FirstPageNumber = -3
    ActiveWindow.SelectedSheets.PrintOut From:=5

    ActiveSheet.PageSetup.CenterFooter = ""
    ActiveSheet.PageSetup.FirstPageNumber = xlAutomatic
End Sub

By setting the .FirstPageNumber property to -3, this means that Excel will treat pages 1-4 as -3, -2, -1, and 0, with page 5 being treated as page 1.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13822) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

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

Sequential Page Numbers Across Worksheets

How do you want your page numbers to appear on your printed worksheets? Chances are good that you want them to be ...

Discover More

Entering a Name in the Header of a Locked Form

When you lock a document as a form, then Word limits what you can do with that document. That includes not being able to ...

Discover More

Capturing a Screen

A picture is worth a thousand words, but getting the pictureâ€""particularly a screen shotâ€""into a workbook may seem ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Setting Print Titles

Excel allows you to specify certain rows or columns that will be repeated on the pages of a printout. Here's how to set ...

Discover More

Printing Gridlines by Default

When you print a worksheet, Excel allows you to also print handy gridlines for the worksheet. If you want to include the ...

Discover More

Changing Cell Values while Printing

When printing mulitiple copies of the same worksheet, you may have a need to change something simple for each of the ...

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 8 - 5?

2021-02-14 07:21:56

Roger Law

Thank you for the solution to my problem of printing no page numbers on the first four pages of my worksheet. I would never have worked that out for myself.
thank you again,
keep safe,
Roger Law.


This Site

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.

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.