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: Resetting Page Setup.

Resetting Page Setup

by Allen Wyatt
(last updated May 17, 2014)

1

Lori wrote concerning a problem she was having with Excel. It seemed that the page setup for every worksheet in every workbook had changed. Worksheets that previously printed on a single page no longer fit on one page, instead printing on two.

The most likely explanations for behavior such as this is that something has changed in relation to how you print your worksheets. I don't mean that you have gone in and changed your page setup—I mean that you have physically changed a printer on your system or that the printer driver used by your system has been changed. Making such changes can universally affect your worksheets.

It is also possible that the change is due to a change in your version of Excel. If you recently upgraded to a different version, then worksheets could be rendered differently by Excel than they used to be.

Unfortunately, the only way to solve this issue—regardless of the cause—is to manually go through each workbook and change the page setup information for each worksheet. It is time consuming, but the only solution available.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2578) 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: Resetting Page Setup.

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

Automatically Formatting Text within Quotes

Some people use quote marks around text to make it stand out. At some point you may want to treat the quoted text ...

Discover More

Fonts Missing in Word

What are you to do if you find that you have no fonts available in Word, but they are available in other programs? There ...

Discover More

Don't Update Links to Other Programs

If you have links in your workbook to data in other workbooks, you may want to control whether Excel updates those links or ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (menu)

Setting Page Margins

When getting ready to print your worksheet, you may want to take a moment to check what margins Excel will use on the ...

Discover More

Scaling Your Printing

If you want to cram more of your worksheet onto each page of a printout, one way to do it is by using scaling. Here's how you ...

Discover More

Changing Paper Size for a Complete Workbook

If you need to change the size of paper on which your worksheets will be printed, it can be bothersome to make the change on ...

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}] in your comment text. You’ll be prompted to upload your image when you submit the comment. 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 six less than 6?

2014-05-17 08:19:02

David Ruben

Of course if frequently take the spreadsheet between different computers or share between people, or as in my case adding or deleting rows destroys carefully crafted page splits along alphabetical entry in column A... then a macro can reset page breaks and the PrintArea; this is triggered by the Workbook_BeforePrint event. The following has constants to set PrintArea end column (presumes starts from column "A", and in example to column "H"), number of title rows at the top (e.g. 5), and the number of rows that will generally always fit depending on font a& fontsize (46 in this example with no enlarged top header text)

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Const iPageRows As Integer = 46
Const iTitleRows As Integer = 5
Const sEndColumn As String = "H"
Dim iBodyRows As Integer, iTopRow As Integer, iRow As Integer
On Error GoTo L_Quit

'Body of text is iPageLength less the iTitleRows rows
iBodyRows = iPageRows - iTitleRows
'Temporarily turn off screen updating
Application.ScreenUpdating = False
'Clear old pagebreaks
ActiveSheet.ResetAllPageBreaks

'Start with row after the header
iRow = iTitleRows + 1

L_TopPage:
'Set Top of current page row
iTopRow = iRow

L_Loop:
'Work through rows to add page breaks
iRow = iRow + 1

'check if reached end of table of data
If Range("A" & iRow) = "" Then GoTo L_Completed

'Pagebreak if new alphabet letter in column A or maximum lines per page
If UCase(Left(Range("A" & iRow), 1)) <> UCase(Left(Range("A" & iRow - 1), 1)) _
Or iRow - iTopRow > iBodyRows Then _
Rows(iRow & ":" & iRow).Select: _
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell: _
GoTo L_TopPage

GoTo L_Loop

L_Completed:
'Set the PrintArea and Title rows
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$" & iTitleRows
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$A$1:$" & sEndColumn & "$" & (iRow - 1)

L_Quit:
Application.ScreenUpdating = True
End Sub


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.