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 Only Non-Blank Worksheets.

Printing Only Non-Blank Worksheets

by Allen Wyatt
(last updated December 20, 2014)

5

Clinton has a workbook containing over 200 worksheets that get populated by various people in his company during the month. At the end of the month he needs to print these worksheets. Not all the worksheets contain data and Clinton only wants to print the worksheets that contain data so he doesn't waste paper. He wonders if there is, perhaps, a macro that he can use to print only those worksheets that have a value in cell G41.

The answer is that such a macro could be written rather easily. It would only need to figure out how many worksheets there are, check cell G41 on each of them, and then print only if there is something in that cell. The following macro performs just these operations.

Sub PrintMost()
    Dim wks As Worksheet
    For Each wks In ActiveWorkbook.Worksheets
        If Not IsEmpty(wks.Range("G41")) Then
            wks.PrintOut
        End If
    Next
    Set wks = Nothing
End Sub

The macro could be easily modified to perform other operations, such as asking if any given worksheet should be printed or asking how many copies should be printed.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10819) 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 Only Non-Blank Worksheets.

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

Deleting Rows before a Cutoff Date

If you are using Excel to work with data that is date-centered, you may want to delete some of the data before a specific ...

Discover More

Adding a File Path and Filename

If you need to stuff the current workbook's filename and path into a cell or a header or footer, you'll appreciate the ...

Discover More

Inserting Foreign Characters

It is not unusual to need to insert foreign characters (often called diacritical marks) as part of your typing. Word provides ...

Discover More

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!

More ExcelTips (ribbon)

Printing a Chart

It is inevitable that if you spend time creating a chart you will want to print that chart on your printer. Here's how you ...

Discover More

Hiding a Hyperlink on a Printout

Hyperlinks can be real handy in a workbook, but you may not always want them visible when you send the workbook to the ...

Discover More

Printing Selected Cells by Default

Want a one-button approach to printing? Excel provides the Quick Print tool, but it may not do exactly what you want. This ...

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}] 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 seven minus 2?

2015-05-22 15:58:49

Willy Vanhaelen

@Rick Sullivan
You just save time because printing an empty page doesn't waist toner nor paper because it's just an empty page and you can reuse it :-)


2015-05-21 12:36:51

Rick Sullivan

Wow. I was searching the web for a solution to my printing woes and this solved my problem perfectly. No more wasted paper and toner.


2015-01-26 12:10:11

Johnny

Is there a way to accomplish this without using a macro? For instance, designate a cell on each worksheet that, if selected, would include the page in the print job and if left unselected it would exclude it from the print job when printing the entire workbook?


2015-01-19 09:23:55

Dennis Costello

I wonder if each of the PrintOut actions would cause a separate print job? If so, each is likely to have its own flag page(s) - there goes the paper savings.


2015-01-19 09:21:56

Dennis Costello

I wonder if following this approach would lead to each of the worksheets (tabs) being its own separately-queued print job? If so, they're likely to end up with separate flag pages for each worksheet (instead of one set for the the entire set of worksheets) - this would not fit well with the paper-savings goal.


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.