Written by Allen Wyatt (last updated July 22, 2021)
This tip applies to Excel 2007, 2010, 2013, and 2016
Dawn has workbooks with multiple tabs (worksheets) in them. She uses "Page of Pages" (X of Y) numbering in the page footers. She notes that she used to be able to print entire workbooks at once and have the numbering come out correctly, with the Y value being the number of pages in each worksheet. Since upgrading to Excel 2016, the Y value on her printouts is always the total number of pages in the workbook, not the number of pages in each worksheet. She wonders if there is a setting in Excel that determines how the Y value is counted (per worksheet or per workbook).
There is no setting that we've been able to locate. Instead, it appears that Excel determines both the X and Y values based on the current print job, not on worksheets or the entire workbook. In other words, if your workbook contains three worksheets, and you print all three, the X and Y values will be different than if you choose to print only the second or the second and third worksheets.
The solution to this is to use a small, simple macro that steps through all the worksheets in a workbook and prints the worksheets individually. As far as Excel is concerned, then, you are performing multiple print jobs, thus the Y value will get reset on a worksheet-by-worksheet basis. Here's the macro:
Sub PrintProperly() Dim sht As Worksheet For Each sht In ActiveWorkbook.Worksheets sht.PrintOut copies:=1 Next sht End Sub
Assign the macro to a shortcut key or to a button on the Quick Access Toolbar, and you'll be able to invoke it easier.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12454) applies to Microsoft Excel 2007, 2010, 2013, and 2016.
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!
Add subtotals to a worksheet and you can instruct Excel to start each new subtotal section on a new printed page. You may ...
Discover MoreNeed to show a custom date in the header or footer of a printout? You'll need to resort to using a macro, as described in ...
Discover MoreHow do you want your page numbers to appear on your printed worksheets? Chances are good that you want them to be ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2018-02-27 18:11:31
Dennis Costello
If you use Allen's macro to print each worksheet in a separate job, would you get a separate flag page for each (when using printers/queues managed by print servers)? When duplex printing (using both side of each piece of paper), and the first worksheet consumes an odd number of pages, how do you control whether the "back side" of that piece of paper is used to begin the next worksheet, or left blank? Similarly, when printing 2-up (two page images, side by side, on a single face of the piece of paper), how do you control whether or not it "keeps going" or "starts over"?
Granted, at some point these things are controlled more by Windows and/or the print drivers than Excel itself, but there are times when you want to have control over them.
(I used to care deeply about these things, but a while back gave up carrying around printed reports and instead downloaded the Excel to my phone and now use a viewer app to thumb through them.)
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 © 2023 Sharon Parq Associates, Inc.
Comments