How to Remove Dotted Lines in Excel (5 Easy Fixes)

Sumit Bansal
Written by

Sumit Bansal is the founder of TrumpExcel.com and a 13-time Microsoft Excel MVP. He started this site in 2013 to share his passion for Excel through easy tutorials, tips, and training videos, helping you master Excel, boost productivity, and maybe even enjoy spreadsheets!

Last updated

Excel is an awesome tool. The more I learn about it the more I fall in love with it.

The team that has built Excel has put in a lot of thinking behind it and they continuously work on improving the user experience.

But there are still some things that I find irritating and often need to change the default settings.

And one such thing is dotted lines in the worksheet in Excel.

In this tutorial, I will show you the possible reasons why these dotted lines appear and how to remove these dotted lines. Each reason has its own fix, so the trick is to first figure out which kind of line you’re looking at.

So let’s get started!

Why Are There Dotted Lines in Excel?

There can be various reasons for the dotted lines to appear in Excel:

  1. Due to Page breaks where Excel visually shows page breaks as dotted lines
  2. Page Break Preview, which shows the page breaks as thick blue lines (dashed for the ones Excel added)
  3. Borders that have been set to show as dotted lines
  4. The moving dotted line that shows up around cells you have just copied
  5. Gridlines that appear in the whole worksheet. These are not really dotted lines (rather faint solid lines that look like dotted borders around the cells)

Your worksheet can have any one or more of these settings and you can easily remove these lines and disable it.

Here is a quick way to tell which one you have:

What you seeWhat it isHow to remove it
Faint gray dashed lines after you print or use Print PreviewPage break linesUncheck Show page breaks in Excel Options
Thick blue lines and a faint “Page 1” in the backgroundPage Break PreviewGo back to Normal view
Dotted lines only around some cellsDotted bordersChoose No Border
A dashed border that keeps moving around a rangeCopy modePress Esc
Light gray lines around every cellGridlinesUncheck Gridlines on the View tab

Let’s dive in and see how to remove these dotted lines in Excel in each scenario.

Remove Page Break Dotted Lines in Excel

This is one of the most irritating things for me in Excel. Sometimes, I see these page-breaks dotted lines (as shown below) that just refuse to go away.

Faint gray dotted page break line between columns H and I in a smoothie sales table

These lines usually show up after you print the sheet, open Print Preview, or change something in Page Setup. Excel then marks where each printed page will end.

Now, I understand the utility and purpose of keeping these. It divides your worksheet into sections and you would know what part will be printed on one page and what will spill over.

A super easy (but not ideal) fix of this is to close the workbook and open again. Reopening a workbook will remove the page break dotted lines.

The catch is that they come back the next time you print or open Print Preview. Here is a better way to remove these dotted lines:

  1. Click on the File tab
The File tab in the Excel ribbon
  1. Click on Options
Options in the File menu
  1. In the Excel Options dialog box that opens, click on the Advanced option in the left pane
The Advanced category in the Excel Options dialog box
  1. Scroll down to the section – “Display options for this worksheet” and make sure the worksheet you want to fix is selected in the drop-down next to it
Display options for this worksheet section with the worksheet drop-down and Show page breaks checked
  1. Uncheck the option – “Show page breaks” and click OK
Show page breaks unchecked in Display options for this worksheet

The above steps would stop showing the page break dotted line for the selected worksheet.

Note that this setting works one worksheet at a time. Other sheets in the same workbook, and other workbooks, will still show the dotted lines, so you will have to repeat the same process for them (or use the VBA code in the next section).

In case you have set the print area in the worksheet, the dotted lines will not be shown outside the print area. Instead, you will see solid lines outlining the print area.

Unchecking Show page breaks hides that outline as well. If you don’t need the print area anymore, you can remove it instead by going to the Page Layout tab and choosing Print Area > Clear Print Area.

If you’re using Excel on a Mac, the option lives in a different place. Go to Excel > Preferences > View, and clear the Page breaks check box under Show in Workbook.

Hide Page Break Lines on All Sheets with VBA

Since the Show page breaks option only works on one sheet at a time, it gets tedious when a workbook has a lot of sheets. A small macro can turn it off for every worksheet in one go.

Here is the VBA code:

Sub HidePageBreaksAllSheets()
    Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Worksheets
        ws.DisplayPageBreaks = False
    Next ws
End Sub

Here are the steps to use this macro:

  1. Press Alt + F11 to open the VBA Editor
  2. Insert a new module (Insert → Module)
  3. Paste the code above
  4. Press F5 to run the macro

The code goes through every worksheet in the active workbook and switches off the page break display on each one. It does the same thing as unchecking Show page breaks on every sheet.

This is a quick fix you run whenever you need it, so you don’t have to keep the code in the workbook. If you save the file as a regular .xlsx, Excel simply drops the module.

Excel doesn’t store the page break display in the file, so the lines stay hidden until you print or open Print Preview again. When they come back, paste the code and run it again.

If you need it often, keep the code in your Personal Macro Workbook so it’s always available.

One thing to know is that Excel only lets you change the page break display when a printer is installed on your computer. Without one, this macro stops with an error.

Get Rid of the Blue Dashed Lines in Page Break Preview

If your sheet suddenly has thick blue lines and a faint “Page 1” in the background, you’re in Page Break Preview.

In this view, the dashed blue lines are page breaks Excel added on its own, and the solid blue lines are the ones someone added manually.

Page Break Preview with a dashed blue automatic page break and a solid blue manual page break

To get out of it, click the View tab and then click Normal in the Workbook Views group.

Normal in the Workbook Views group on the View tab

Back in Normal view, the blue lines turn into the regular faint page break lines. If those bother you too, turn off Show page breaks as shown earlier.

You can also switch views from the status bar or with a keyboard shortcut, which I cover in how to return to Normal view in Excel.

Remove Manual Page Breaks That Keep Coming Back

Sometimes the dotted lines are page breaks that someone added by hand. You can spot them in Page Break Preview, where they show up as solid blue lines instead of dashed ones.

Hiding them with Show page breaks works, but the breaks are still there and will still decide where each printed page ends.

To get rid of the manual page breaks themselves, go to the Page Layout tab, click Breaks in the Page Setup group, and choose Reset All Page Breaks.

Reset All Page Breaks in the Breaks drop-down on the Page Layout tab

This removes every manual page break on the sheet and leaves only the automatic ones Excel needs for printing. Those automatic lines can still show up as dotted lines, so turn off Show page breaks if you want them gone too.

To remove or move just one break, check out my guide on inserting and removing page breaks in Excel.

Remove Dotted Line Borders in Excel

In some cases (not as common as page break though), people may use dotted lines as the border.

Something as shown below:

A smoothie menu table with dotted cell borders

To remove these dotted lines, you can either remove the border completely or change the dotted line border to the regular solid line border.

Below are the steps to remove these dotted borders:

  1. Select the cells from which you want to remove the dotted border
Cells with dotted borders selected
  1. Click the Home tab
The Home tab in the Excel ribbon
  1. In the Font group, click on the ‘Border’ drop-down
The Borders drop-down in the Font group on the Home tab
  1. In the border options that appear, click on ‘No Border’
No Border in the border options

The above steps would remove any borders in the selected cells.

In case you want to replace the dotted border with some other type of border, you can do that as well. Press Ctrl + 1 to open Format Cells, go to the Border tab, pick a solid line style, and then click Outline and Inside.

Remove the Moving Dotted Line Around Copied Cells

When you copy cells with Ctrl + C, Excel puts a moving dashed border around them. It stays there until you paste with Enter, start typing in another cell, or cancel the copy.

Moving dashed border around copied cells A1:C6

To remove it, just press the Esc key. The moving line disappears, and nothing in your data changes.

Remove Gridlines in Excel

While the gridlines are not dotted lines (these are solid lines), some people still think that these look like dotted lines (as these are quite faint).

These gridlines are applied to the entire worksheet and you can easily make them disappear.

Light gray gridlines around every cell in the worksheet

Below are the steps to remove these:

  1. Click on the View tab
The View tab in the Excel ribbon
  1. In the Show group, uncheck the Gridlines option
Gridlines unchecked in the Show group on the View tab

That’s it! The above steps would remove all the gridlines from the worksheet.

In case you want the Gridlines back, simply go back and check the same option.

So these are five ways you can remove the dotted lines in Excel. If the lines are still there after one fix, check the table at the top again, since a sheet can have more than one kind at the same time.

I hope you found this tutorial useful!

Some Other Excel tutorials you may also like:

Sumit Bansal

Sumit Bansal

13x Microsoft Excel MVP

Hey! I'm Sumit Bansal, founder of trumpexcel.com and a Microsoft Excel MVP. I started this site in 2013 because I genuinely love Microsoft Excel (yes, really!) and wanted to share that passion through easy Excel tutorials, tips, and Excel training videos. My goal is straightforward: help you master Excel skills so you can work smarter, boost productivity, and maybe even enjoy spreadsheets along the way!

3 thoughts on “How to Remove Dotted Lines in Excel (5 Easy Fixes)”

Leave a Comment

Get the FREE 51 Excel Tips Ebook

Enter your details and the free PDF is on its way to your inbox.

Hmm, that didn't go through. Please check your email and try again.

No spam. You'll also get my weekly Excel newsletter. Unsubscribe anytime.

Check your inbox!

The ebook is on its way to your email. It usually lands within a couple of minutes.