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: Repeating Rows on a Printout Except On the Last Page.

Repeating Rows on a Printout Except On the Last Page

Written by Allen Wyatt (last updated January 10, 2022)
This tip applies to Excel 97, 2000, 2002, and 2003


2

Nancy knows how to format a worksheet so that rows are repeated at the top of each page of a printout. What she wants to do, however, is to have the rows repeated at the top of each printed page except the last one.

There is no direct way to do this, but you can simulate such a printing by using a macro to do the task. All you need to do is have the macro print all except your last page, then change the page setup so that rows are not repeated, and finally print the final page of the printout. The following macro provides an example of this approach.

Sub PrintWorksheet()
    Dim lPages As Long
    Dim sTemp As String

    lPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
    With ActiveSheet.PageSetup
        ActiveSheet.PrintOut From:=1, To:=lPages - 1
        sTemp = .PrintTitleRows
        .PrintTitleRows = ""
        ActiveSheet.PrintOut From:=lPages, To:=lPages
        .PrintTitleRows = sTemp
    End With
End Sub

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 (3389) 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: Repeating Rows on a Printout Except On the Last Page.

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

Determining if Calculation is Necessary

When processing a worksheet with a macro, it may be helpful to periodically recalculate the worksheet. Wouldn't it be ...

Discover More

Adding Paragraph Numbering

You may search high and low for a way to add automatic numbers to paragraphs in a document. You won't find the ...

Discover More

Creating a Bibliography from Footnotes

Most scholarly papers need to have both footnotes and a bibliography. The two are closely related, as they provide ...

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)

Printing a Number of Different Pages

If you don't need to print an entire workbook, it can be confusing to figure out how to print just certain pages. This ...

Discover More

Printing Limited Pages from a Range of Worksheets

Need to print just a few pages from a group of worksheets? The easiest way to handle the task may be through a macro, as ...

Discover More

Printing a Worksheet List

Want a list of all the worksheets in your workbook? Here's a short, handy macro that will place all the worksheet names ...

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 6 + 5?

2020-02-20 08:42:36

Elmer

It does not work?


2017-10-27 12:33:55

Cindy

Do a new sheet without the rows to repeat at top. Then print the workbook. In my experience the last page
is usually a summary page


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.