Printing Gridlines by Default

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


When Kenneth prints a worksheet, 99% of the time he prefers printing it with gridlines. However, the gridlines check box (on the Sheet tab of the Page Setup dialog box) is not selected by default. Kenneth wonders if there is a way to change this setting so that it is always selected.

There are actually a couple of different ways you can approach this task. If you want all of your future workbooks or worksheets to have the gridlines turned on by default, start by create a default workbook and worksheet that Excel will rely on when creating these. How you do this has been covered in other ExcelTips, such as this one:

Creating Default Formatting for Workbooks and Worksheets

Note that this approach affects all newly created worksheets or workbooks; it doesn't affect any that were previously created. If you want to affect those, you might want to consider a simple macro to turn on the gridlines. This could be assigned to either a shortcut key or to the Quick Access Toolbar. Here's an example of one that turns on the gridlines:

Sub GridlinesOn()
    ActiveSheet.PageSetup.PrintGridlines = True
End Sub

That's it—a single line. You can, if desired, also get fancier with the macro so that it toggles the gridlines and displays their state. Here's an example:

Sub GridlinesToggle()
    Dim sStatus As String

    sStatus = "OFF"
    With ActiveSheet.PageSetup
        .PrintGridlines = Not .PrintGridlines
        If .PrintGridlines Then sStatus = "ON"
    End With
    Msgbox "The gridlines are now " & sStatus
End Sub

Finally, you could also create a macro that makes sure the gridlines are turned on and then prints the current worksheet. This requires adding a single line to the earlier macro that turned on the gridlines:

Sub PrintGridlines()
    ActiveSheet.PageSetup.PrintGridlines = True
    ActiveSheet.PrintOut
End Sub

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13515) 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

Deleting a Final Blank Page

When creating a document, if can be frustrating to have a blank page somehow appear at the end of the document. If you ...

Discover More

Automatic Blank Pages at the End of a Section

If you want to have a blank page at the end of a document section, you can insert one manually or you can use the ...

Discover More

Printing a Macro List

Need a list of all the macros you've created? Word doesn't provide a way to create such a list, but you can use the ...

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)

Conditional Printing

If you need to make what Excel prints be based upon conditions in a worksheet, you'll love the information in this tip. ...

Discover More

Scaling Your Printing

If you want to cram more of your worksheet onto each page of a printout, one way to do it is by using scaling. Here's how ...

Discover More

Printing a Short Selection

Need to print just a portion of a worksheet? It's easy to do if you follow the steps in 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}] (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 8 - 5?

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.