Why are lines not showing in Excel print preview?

Author: Oscar Cronquist Article last updated on August 22, 2020

Why are lines not showing in Excel print preview?

Have you ever wondered how these lines got there on a worksheet?
They show where pages will break, in other words, they show how much of the worksheet that will be printed on a single paper or pdf.

If you press with left mouse button on Page Break Preview button on tab "View" and then press with left mouse button on "Normal" button, the lines appear, however, they don't disappear automatically.

So how do you get rid of them? You can't easily disable them press with left mouse button oning a button on the ribbon, unfortunately, you must go to the Excel Options and disable it there. See detailed instructions below.

What's on this page

  • How to delete print preview lines [Excel 2010-2016]
  • How to remove print preview lines using Immediate window
  • How to delete print preview lines [Excel 2007]
  • How to delete print preview lines [Excel 2003]
  • How to delete print preview lines [Mac Excel 2011]
  • How to remove Print preview lines programmatically (VBA)

I made a macro, demonstrated later in this article, that you can use to quickly disable the print preview lines, put it in your personal toolbox and use it whenever necessary.

There is also a macro-enabled workbook for you to get further down in this post. It seems that if you close the workbook and then open it again the print preview lines disappear, however, this is in my opinion to much work to only remove the lines.

How to remove dotted lines (Excel Options)

  1. Press with mouse on tab "File" on the ribbon.
    Why are lines not showing in Excel print preview?
  2. Press with mouse on "Options"
  3. Press with mouse on tab "Advanced".
  4. Scroll down to "Display Options for this worksheet".
    Why are lines not showing in Excel print preview?
  5. Disable "Show Page Breaks".
  6. Press with left mouse button on "OK" button.

How to remove dotted lines (Immediate window)

Why are lines not showing in Excel print preview?

If you are familiar with the Immediate window in the Visual Basic Editor you can probably more quickly delete the print preview lines than through Excel Options.

  1. Copy code below.
  2. Press Alt+F11 to open the VB Editor.
  3. Paste code to the Immediate window
  4. Press Enter
  5. Return to Excel
ActiveSheet.DisplayPageBreaks = False

How to remove print preview dotted lines [Excel 2007]

  1. Press with left mouse button on the Office button located at the top left side of your screen.
    Why are lines not showing in Excel print preview?
  2. Press with left mouse button on "Excel Options".
  3. Press with left mouse button on tab "Advanced" in the left window.
  4. Find "Display Options for this Worksheet".
  5. Disable the check box "Show Page Breaks"
  6. Press with left mouse button on "OK" button.

How to remove print preview dotted lines [Excel 2003]

  1. Go to the Tools menu.
  2. Press with left mouse button on Options.
  3. Press with left mouse button on the View tab.
  4. Disable checkbox Page Breaks found in Windows Options.
  5. Press with left mouse button on OK button.

Excel 2011 Macintosh

Why are lines not showing in Excel print preview?

  1. Go to "Preferences" on the menu.
  2. Press with left mouse button on View in "Authoring".
  3. Disable checkbox "Show Page Breaks" located below "Windows Options"

Build a macro and automate these steps

If you often disable print preview lines manually why not build a macro that does it for you? It is not hard, simply copy the macro and paste it to your workbook module.

If you want to use it any workbook you open, put it in a personal macro workbook and link it to the Quick Access Toolbar or the ribbon.

Why are lines not showing in Excel print preview?

In fact, you can save useful macros in your personal macro workbook and become a lot more efficient in your work.

Macro to disable print preview lines

Why are lines not showing in Excel print preview?

What happens if we record a macro while disabling "Page Breaks" in Excel options? This is what the macro recorder returns:

Macro1()
ActiveSheet.DisplayPageBreaks = False
End Sub

Use the above line in the examples below if you don't want to toggle print preview lines.

Macro toggles print preview lines on the active worksheet

Why are lines not showing in Excel print preview?

Using that code you can now show or hide "Page Breaks" on the active sheet with a macro. Meaning, if "Page Breaks" are visible this macro hides them. If "Page Breaks" are hidden, the macro makes them visible.

Sub Macro1()
ActiveSheet.DisplayPageBreaks = Not ActiveSheet.DisplayPageBreaks
End Sub

Macro toggles print preview lines on every sheet in the workbook

Why are lines not showing in Excel print preview?

The following macro shows or hides "Page Breaks" on every sheet in the current workbook.

Sub Macro2()
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
    sh.DisplayPageBreaks = Not sh.DisplayPageBreaks
Next sh
End Sub

Macro toggles print preview lines on every sheet in all open workbooks

Why are lines not showing in Excel print preview?

This macro toggles "Page Breaks" on every sheet in every open workbook.

Sub Macro3()
Dim wb As Workbook
Dim sh As Worksheet
For Each wb In Workbooks
    For Each sh In wb.Worksheets
        sh.DisplayPageBreaks = Not sh.DisplayPageBreaks
    Next sh
Next wb
End Sub

Watch a video where I explain how to use the macros above

Where to put the code

  1. Copy the preferred macro above.
  2. Go to Visual Basic Editor (VBE). (Alt + F11)
    Why are lines not showing in Excel print preview?
  3. Press with left mouse button on "Insert" on the menu.
  4. Insert a new module.

Don't forget to save the workbook as a macro-enabled workbook  (*.xlsm file) or the macro is gone the next time you open the workbook.

Here is how to put this macro on the Excel ribbon:

Recommended articles

Why are lines not showing in Excel print preview?

  • Print gridlines in a worksheet
  • Page Break Preview

Why are lines not showing in Excel print preview?

Why are lines not showing in Excel print preview?

Why are lines not showing in Excel print preview?

How to find errors in a worksheet
Excel has great built-in features. The following one lets you search an entire worksheet for formulas that return an error. […]

Why are lines not showing in Excel print preview?

How to quickly select a cell range
Selecting cell ranges in Excel can sometimes be a real pain scrolling forever it seems. There is a quick and easy […]

Why are lines not showing in Excel print preview?

Why are lines not showing in Excel print preview?

How to find blank cells
In this article, I am going to show you two ways on how to find blank cells. Both techniques are […]

Why are lines not showing in Excel print preview?

How to quickly select blank cells
In this smaller example, column D (Category) has empty cells, shown in the picture above. If your column contains thousands of […]

Why are lines not showing in Excel print preview?

Why are lines not showing in Excel print preview?

How to select cells with data
The picture above shows data in column B, some cells contain nothing, they are blank. I will now go through […]

Why are lines not showing in Excel print preview?

Why are lines not showing in Excel print preview?

Convert column number to column letter
Use the following formula to convert a column number to a column letter: =LEFT(ADDRESS(1, B3, 4), MATCH(B3, {1; 27; 703})) […]

Why are lines not showing in Excel print preview?

Improve worksheet readability
Making your sheets easy to read is a fundamental approach of creating useful worksheets. Your message must be crystal clear, […]

Why are lines not showing in Excel print preview?

Rotate text to save space
If your cell text is taking to much space Excel allows you to rotate text in any angle. Here are […]

Why are lines not showing in Excel print preview?

Create a numbered list ignoring blank cells
The formula in column B returns a running count based on values in column C. Formula in cell B3: =IF(C3<>"",COUNTA($C$3:C3),"") […]

Why are lines not showing in Excel print preview?

How to format numbers as text
A number that is formatted as text will be left-aligned instead of right-aligned, this makes it easier for you to […]

Latest updated articles.

More than 300 Excel functions with detailed information including syntax, arguments, return values, and examples for most of the functions used in Excel formulas.

More than 1300 formulas organized in subcategories.

Excel Tables simplifies your work with data, adding or removing data, filtering, totals, sorting, enhance readability using cell formatting, cell references, formulas, and more.

Allows you to filter data based on selected value , a given text, or other criteria. It also lets you filter existing data or move filtered values to a new location.

Lets you control what a user can type into a cell. It allows you to specifiy conditions and show a custom message if entered data is not valid.

Lets the user work more efficiently by showing a list that the user can select a value from. This lets you control what is shown in the list and is faster than typing into a cell.

Lets you name one or more cells, this makes it easier to find cells using the Name box, read and understand formulas containing names instead of cell references.

The Excel Solver is a free add-in that uses objective cells, constraints based on formulas on a worksheet to perform what-if analysis and other decision problems like permutations and combinations.

An Excel feature that lets you visualize data in a graph.

Format cells or cell values based a condition or criteria, there a multiple built-in Conditional Formatting tools you can use or use a custom-made conditional formatting formula.

Lets you quickly summarize vast amounts of data in a very user-friendly way. This powerful Excel feature lets you then analyze, organize and categorize important data efficiently.

VBA stands for Visual Basic for Applications and is a computer programming language developed by Microsoft, it allows you to automate time-consuming tasks and create custom functions.

A program or subroutine built in VBA that anyone can create. Use the macro-recorder to quickly create your own VBA macros.

UDF stands for User Defined Functions and is custom built functions anyone can create.

A list of all published articles.

Why do lines disappear in Excel when printing?

Troubleshoot printing issues with gridlines – If gridlines don't show up when you print your worksheet, or if you can't see them in the Print Preview window, check that the Draft quality check box is not selected. The Draft quality check box appears on Sheet tab in the Page Setup dialog box.

How do I make lines visible in Excel when printing?

On the File menu, click Print..
Click the sheet..
On the Layout tab, under Print, select the Gridlines check box..
On the File menu, click Print..