Dynamically Setting a Print Area

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:

  1. Select a random cell or range of cells; it doesn't really matter at this point.
  2. Display the Page Layout tab of the ribbon.
  3. Click the Print Area tool. Excel displays two options.
  4. Choose the Set Print Area option.

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:

  1. Press Ctrl+F3. Excel displays the Name Manger.
  2. If there is more than one named range, select the Print_Area name.
  3. Click the Edit button. Excel displays the Edit Name dialog box. (See Figure 1.)
  4. Figure 1. The Edit Name dialog box.

  5. In the Refers To box, at the bottom of the dialog box, replace whatever is there with the following formula. (If the name of the worksheet is different from what is shown in this formula, make the necessary change to reflect reality.)
  6. =OFFSET(INDIRECT(Sheet1!$A$1),,,20,5)
    
  7. Click OK to close the Edit Name dialog box.
  8. Click OK again to close the Name Manager.

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.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Inserting Worksheet Values with a Macro

Macros are often used to process information in a worksheet. You may need your macro to change the values stored in ...

Discover More

Undesired Font in Form Fields

If you get unwanted formatting in your form fields, it could be because of the way you are formatting the line on which ...

Discover More

Rounding Time

Need to round the time in a cell to a certain value? There are a couple of ways you can do this with a formula.

Discover More

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!

More ExcelTips (ribbon)

Using a Macro to Set a Print Range

Excel allows you to specify a print range that defines what should be printed from a given worksheet. This tip shows how ...

Discover More

Adding the Set Print Area Tool

Spend a lot of time defining print areas in your workbooks? You might benefit by adding a Set Print Area tool to the ...

Discover More

Clearing the Print Area

Excel allows you to specify which portions of a worksheet should be printed when you send output to your printer. If you ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.