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: Using Multiple Print Settings.
by Allen Wyatt
(last updated June 23, 2018)
If you have multiple areas that you print in a worksheet, you may get tired of repeatedly specifying what area you want to print and then printing it. Such a task is well suited to being done with a macro. The macro can take care of specifying a print area and then actually printing the information.
For instance, let's assume that you have two print ranges defined in your worksheet: Range1 and Range2. Further, Range1 should be printed in portrait orientation and Range2 should be printed in landscape orientation. The following macros can be used to print each of the print ranges:
Sub PrintRange1() ActiveSheet.PageSetup.PrintArea = Range("range1").Address ActiveSheet.PageSetup.Orientation = xlPortrait ActiveWindow.SelectedSheets.PrintOut End Sub
Sub PrintRange2() ActiveSheet.PageSetup.PrintArea = Range("range2").Address ActiveSheet.PageSetup.Orientation = xlLandscape ActiveWindow.SelectedSheets.PrintOut End Sub
These are very simple macros, but you get the idea—all you need to do is set up the print job in the macro, and then print from the macro itself. You could even attach the macros to toolbar buttons or to a menu option, as described in other issues of ExcelTips.
If you prefer to not use macros, you could also use the custom views feature of Excel. Simply set the print area, orientation, margins, and other settings desired. Then define this as a custom view. To define a custom view, follow these steps:
Figure 1. The Custom Views dialog box.
You can continue to define and save additional views, as desired. Your custom views are saved with your workbook, and you can later use them to print what you want. (Just display the custom view and then print your worksheet.)
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2703) 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: Using Multiple Print Settings.
Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!
Excel can print your worksheet on just about any paper size you can imagine. How you select the paper size you want used ...Discover More
If you want to automatically print a particular area of your worksheet at a specific time of day, you'll love this tip. ...Discover More
Need to only print out certain rows from your data? It's easy to do if you apply the filtering or sorting techniques ...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 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.