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

Setting the Starting Line Number

Line numbers are an important part of some documents, such as those prepared in the legal profession. If you want to ...

Discover More

Counting Dates in a Range

Excel makes working with a list of dates relatively easy. If you have a list of dates, you may need to know how many of ...

Discover More

Searching for Special Characters

When using the Find and Replace feature of Word, you can search for more than plain text. You can also search for ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Adding Page Borders to a Printout

Need a full-page border on your Excel printouts? It's not as easy to get one as you might wish. There are a few ways you ...

Discover More

Printing a Portion of a Worksheet

Need to print a portion of a worksheet, but don't want to waste paper by printing the whole thing? It's easy to print ...

Discover More

Automatically Printing a Range

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
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 8 + 0?

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.