Written by Allen Wyatt (last updated December 21, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021
Travis has a cell that, through a series of formulas, contains the upper-left corner of a 5 column by 20 row area that needs to be printed. For instance, if the cell contains $F$15, then the print area would be F15:J34, but if it contained $D$45, then the print area would be D45:H64. Travis wonders if it is possible to dynamically set the print area based on the contents of the cell, without using a macro.
Yes, there is a way you can set a dynamic print area without using a macro. Let's assume for the purposes of this tip that the calculated cell address is in A1. In preparation, you need to set up a print area:
When you set a print area in this manner, Excel creates a named range called Print_Area. Whatever range it refers to is what will be printed when you choose to print. Since it is a named range, you can modify it in the Name Manager. Follow these steps to make the print area dynamic:
Figure 1. The Edit Name dialog box.
=OFFSET(INDIRECT(Sheet1!$A$1),,,20,5)
That's it. Your print area is now dynamic, dependent on the address stored in cell A1.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13946) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.
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 allows you to specify a print range that defines what should be printed from a given worksheet. This tip shows how ...
Discover MoreSpend a lot of time defining print areas in your workbooks? You might benefit by adding a Set Print Area tool to the ...
Discover MoreExcel allows you to specify which portions of a worksheet should be printed when you send output to your printer. If you ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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 © 2024 Sharon Parq Associates, Inc.
Comments