Printing in Black and White and Color

Written by Allen Wyatt (last updated February 15, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


Ken has a workbook containing 30 worksheets. He would like to print sheets 1 through 29 in black and white and sheet 30 in color. He wonders if there is a way to print all the worksheets at once and specify that a particular worksheet should print in color only.

This is easiest done with a macro. All it takes is to set the .BlackAndWhite property for each worksheet just before it is printed. For instance, consider the following simple macro:

Sub PrintSingleColorSheet()
    Dim w As Worksheet
    Dim S As Integer

    ' Set worksheet to be in color
    ' (All others will print in B/W)
    S = 30

    For Each w In Worksheets
        w.PageSetup.BlackAndWhite = True
        If w.Index = S Then
            w.PageSetup.BlackAndWhite = False
        End If
        w.PrintOut
    Next w
End Sub

The macro stores in the S variable the index number of the worksheet you want to be in color. (In this case, the index number is 30.) Then, each worksheet is stepped through and the .BlackAndWhite property set to True. If, however, the .Index property for the worksheet matches the value stored in S, then the .BlackAndWhite property is set to False, meaning it will print in color. The printout is then sent to the default printer.

You could, if you wanted, get fancier with the macro, meaning you could have it ask the user which worksheet to print in color:

Sub PrintSingleColorSheet()
    Dim w As Worksheet
    Dim S As Integer
    Dim sTemp As String
    Dim sMsg As String

    sMsg = "There are " & Worksheets.Count & " worksheets in this "
    sMsg = sMsg & "workbook. Please enter the number of the single "
    sMsg = sMsg & "worksheet you want to print in color. (All "
    sMsg = sMsg & "others will print in black and white.)"

    sTemp = InputBox(sMsg)
    S = Val(sTemp)
    If S > 0 And S <= Worksheets.Count Then
        For Each w In Worksheets
            w.PageSetup.BlackAndWhite = True
            If w.Index = S Then
                w.PageSetup.BlackAndWhite = False
            End If
            w.PrintOut
        Next w
    Else
        sMsg = "You entered a value that is out of range."
        If sTemp <> "" Then
            MsgBox sMsg
        End If
    End If
End Sub

This version of the macro asks the user to input a worksheet number. If the value entered is out of range, then an error message is displayed, and the macro doesn't print anything. If the user clicks Cancel or leaves the input box empty, then the macro simply exits without printing anything.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13738) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

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

Tracked Changes Notification when Opening

If you have Word configured to show markup on-screen and you look through a document, it is easy to tell where changes ...

Discover More

Running a Macro in a Number of Workbooks

Got a macro that you need to run on each of a number of workbooks? Excel provides a number of ways to go about this task, ...

Discover More

Turning Off Document Protection

If you protect your document using the tools that Word provides, at some time you may need to turn off that protection. ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Repeating Columns at the Right

You can design your worksheet so you can repeat rows at the top of a printout or columns at the left. Repeating columns ...

Discover More

Printing Just the Visible Data

In a large worksheet, you may want to display and print just a portion of the available data. Displaying the desired ...

Discover More

Printing Multiple Pages On a Piece of Paper

If you want to save paper on a printout, you might consider printing multiple pages on a single piece of paper. This can ...

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.