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:
- Due to Page breaks where Excel visually shows page breaks as dotted lines
- Page Break Preview, which shows the page breaks as thick blue lines (dashed for the ones Excel added)
- Borders that have been set to show as dotted lines
- The moving dotted line that shows up around cells you have just copied
- 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 see | What it is | How to remove it |
|---|---|---|
| Faint gray dashed lines after you print or use Print Preview | Page break lines | Uncheck Show page breaks in Excel Options |
| Thick blue lines and a faint “Page 1” in the background | Page Break Preview | Go back to Normal view |
| Dotted lines only around some cells | Dotted borders | Choose No Border |
| A dashed border that keeps moving around a range | Copy mode | Press Esc |
| Light gray lines around every cell | Gridlines | Uncheck 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.

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:
- Click on the File tab

- Click on Options

- In the Excel Options dialog box that opens, click on the Advanced option in the left pane

- 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

- Uncheck the option – “Show page breaks” and click OK

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 SubHere are the steps to use this macro:
- Press Alt + F11 to open the VBA Editor
- Insert a new module (Insert → Module)
- Paste the code above
- 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.

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

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.

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:

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:
- Select the cells from which you want to remove the dotted border

- Click the Home tab

- In the Font group, click on the ‘Border’ drop-down

- In the border options that appear, click on ‘No Border’

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.

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.

Below are the steps to remove these:
- Click on the View tab

- In the Show group, uncheck the Gridlines option

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:
- How to Remove Line Breaks in Excel
- How to Remove Table Formatting in Excel
- Remove Parentheses in Excel
- Use Format Painter in Excel to Quickly Copy Formatting
- How to Split a Cell Diagonally in Excel (Insert Diagonal Line)
- How to Insert/Draw a Line in Excel (Straight Line, Arrows, Connectors)
- Return to Normal View in Excel
- Enable Dark Mode in Microsoft Excel
- How to Remove Header and Footer in Excel
- How to Print the Top Row on Every Page in Excel (Repeat Row/Column Headers)
This was driving me crazy and you saved my (relative) sanity. THANKYOU
This was helpful. Thanks.
This is a wonderful and very helpful page.