Written by Allen Wyatt (last updated January 9, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
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 (9604) 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: Resetting Page Setup.
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!
Need to print your worksheet on a non-standard paper size? Excel is rather limited in printing to such papers, and here ...
Discover MoreNeed a full-page border on your Excel printouts? It's not as easy to get one as you might wish. There are a few ways you ...
Discover MoreShould you print in portrait or in landscape? The decision can greatly affect the way your printout looks. Wouldn't it be ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-01-09 15:56:12
Tomek
Isn't it possible that changing printing preferences for the new printer or fora printer with a new driver would return to the desired output?
2021-01-09 08:59:44
Graham Rice
The task is actually very easy to automate for all Worksheets / Workbooks that require the same setup. The answer is to use a macro, probably best to store it in a separate workbook, such as the Personal.xls
First manually setup the printing options for a SINGLE worksheet.
Then start the 'Record Macro' option and select the required storage location.
From the Ribbon select 'Page Setup'
NO NEED TO DO ANYTHING IN THIS DIALOGUE.
Click 'OK' or 'Cancel'
Stop the macro.
Although you have not actually done anything in this macro, all of the current print options are recorded. Below is an example from my computer.
########################################
Sub Macro1()
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = "$A:$D"
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0)
.RightMargin = Application.InchesToPoints(0)
.TopMargin = Application.InchesToPoints(0.393700787401575)
.BottomMargin = Application.InchesToPoints(0.196850393700787)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintHeadings = False
.PrintGridlines = True
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 3
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = False
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
End Sub
########################################
This macro can then be run on any other Worksheet to give an identical printing setup.
It could be modified to run through all Worksheets in a Workbook, for example enclose the code above with :-
Sub Macro1()
Dim WS_Count As Integer
Dim I As Integer
' Set WS_Count equal to the number of worksheets in the active workbook.
WS_Count = ActiveWorkbook.Worksheets.Count
For I = 1 To WS_Count
' INSERT THE CODE HERE.
Next I
End Sub
A similar approach could be used to select all Workbooks in a folder.
The macro above was recorded within Excel 2019, although it should be similar with earlier versions. I do recall that when running Excel 2010 the code included some lines naming my specific printer. You may need to remove these lines, especially if sharing the code with other people.
Obviously if you have several alternative printing setups you can repeat the process for each setup.
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