Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Printing Limited Pages from a Range of Worksheets.
by Allen Wyatt
(last updated December 13, 2018)
Ian puts together Excel workbooks that typically contain, at minimum, 30 worksheets. Each worksheet, if printed, requires a minimum of eight pages. Ian often updates the data in each worksheet that would appear on the first two printed pages of those worksheets. When it comes time to print, Ian would like a way to print just the first two pages of each worksheet.
When you select a range of worksheets and then choose to print, those worksheets are considered by Excel to be a single, contiguous print job. So, for instance, if you selected 20 worksheets and each worksheet required eight pages, that would not be treated by Excel as 20 individual print jobs of eight pages each, but as a single 160-page print job.
Theoretically you could specify, in the Print dialog box (Excel 2007 and Excel 2010) or the print settings page (Excel 2013), that you wanted to print pages 1, 2, 9, 10, 17, 18, etc., but this is prone to error and quite tedious. It gets even more difficult if the worksheets being printed consist of varying numbers of pages.
The best solution is to write a macro that will do the printing for you. The macro can step through however many worksheets you've selected and print only the first two pages of each of those worksheets. The following macro implements this technique:
Sub PrintTwoPages() Dim sht As Variant For Each sht In ActiveWindow.SelectedSheets sht.PrintOut From:=1, To:=2, Preview:=True Next Set sht = Nothing End Sub
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9579) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Printing Limited Pages from a Range of Worksheets.
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!
If you are using a macro to create your printed Excel output, you may need a way to specify that paper should come from a ...Discover More
Adding a watermark to the background of a printout can be challenging. This tip explains the different ways you can ...Discover More
Need to access the advanced capabilities of a printer from within an Excel macro? You may be out of luck, unless you ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.