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

Prohibiting Single-Digit Entries in a Cell

The Data Validation capabilities of Excel can be very helpful when you are trying to control what people can enter into a ...

Discover More

Changing Default Search Settings

Excel provides some great tools for finding information in a worksheet or a workbook. Changing the default settings used ...

Discover More

Controlling Data Entry in a Cell

Sometimes you want whatever is displayed in one cell to control what is displayed in a different cell. This tip looks at ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (menu)

Conditional Printing

If you need to make what Excel prints be based upon conditions in a worksheet, you'll love the information in this tip. ...

Discover More

Adjusting Comment Printouts

Need to print out comments, but in a way that you control what is included in the printout? Here's a way you can extract ...

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
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 1 + 1?

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.