If you are looking for some of the easiest ways to remove dotted lines in Excel, then you are in the right place. Sometimes you may have some unwanted dotted lines in your worksheet and it may be unpleasant to you. So, to get rid of these dotted lines follow this article.
5 Ways to Remove Dotted Lines in Excel
Here, we have the following data table which has some dotted lines and by using this table we will explain the ways to remove these dotted lines one by one.
We have used Microsoft Excel 365 version here; you can use any other version according to your convenience.
Method-1: To Remove Dotted Lines in Excel because of Page Break Selection
Let’s talk about the page break lines at first, you can see these dotted lines in the following figure. This page break line indicates that the left portion of this line will be printed on one page. To remove this unwanted line from your worksheet you can follow this method.
➤ Go to the File Tab.
➤ Click on Options.
Then, the Excel Options wizard will pop up.
➤ From the list of options select the Advanced one.
Now, scroll through the Advanced options shown on the right side and find the Display options for this worksheet section.
➤ Unclick the Show page breaks option and press OK.
Finally, you will be able to remove the page break line from your worksheet.
Read More: How to Remove the Page Break Lines in Excel (3 Ways)
Method-2: To Remove Dotted Lines in Excel Because of Print Area Selection
For selecting a specified area of your worksheet as a print area you can see the following dotted lines which are surrounding the area to be printed. These lines are not actually the dotted lines rather they are basically some faded grey lines. But, they can be considered as dotted lines and in this section, we will remove them.
➤ Select the area from which you want to remove these lines.
➤ Go to Page Layout Tab >> Page Setup Group >> Print Area Dropdown >> Clear Print Area Option.
In this way, you have removed the dotted lines due to the print area selection.
Related Content: How to Remove Print Lines in Excel (4 Easy Ways)
Method-3: To Remove Dotted Lines in Excel Because of Dotted Borders
Here, we have some dotted borders around the cells of our data table and we want to replace them with solid border lines.
➤ Select the cells from which you want to remove the dotted lines.
➤ Go to Home Tab >> Borders Dropdown >> All Borders Option (you can select the No Border option if you don’t want any border).
Finally, the dotted borders of our data table have been replaced with solid borders.
Read More: How to Remove Borders in Excel (4 Quick Ways)
- How to Remove Partial Data from Multiple Cells in Excel (6 Ways)
- Remove Timestamps from Date in Excel (4 Easy Ways)
- How to Remove Number Error in Excel (3 Ways)
- Delete Blank Cells and Shift Data Left in Excel (3 Methods)
- How to Remove Symbol in Excel (8 Ways)
Method-4: To Remove Dotted Lines in Excel Because of Gridlines
By default, when you open an Excel worksheet you will see some dotted (basically faded grey lines) borders covering each cell of your worksheet. If you want to remove them easily then follow this method.
➤ Go to View Tab >> Uncheck the Gridlines Option.
Afterward, you will be able to remove the gridlines of your sheet like below.
Read More: How to Remove Grid from Excel (6 Easy Methods)
Method-5: Using VBA Code to Remove Page Break Line
In this section, we will try to remove the page break lines by using a VBA code.
➤ Go to Developer Tab >> Visual Basic Option.
Then, the Visual Basic Editor will open up.
➤ Go to Insert Tab >> Module Option.
After that, a Module will be created.
➤ Write the following code
Sub dotted1() ActiveSheet.DisplayPageBreaks = False End Sub
This code will hide the page break lines from the active sheet of your file.
➤ Press F5.
After that, you will be able to remove all of the page break lines from your sheet.
For removing the page break lines from all of the sheets of your workbook you can follow this code.
Sub dotted2() Dim sheet As Worksheet For Each sheet In ActiveWorkbook.Worksheets sheet.DisplayPageBreaks = False Next sheet End Sub
Here, the FOR loop will go through each sheet of your workbook and hide the page break lines.
If you want to remove the page break lines from all of the sheets from all of the opened workbooks then this code is for you.
Sub dotted3() Dim book As Workbook Dim sheet As Worksheet For Each book In Workbooks For Each sheet In book.Worksheets sheet.DisplayPageBreaks = False Next sheet Next book End Sub
Here, we have declared the book as Workbook and the sheet As Worksheet. One FOR loop will go through each book and the other FOR loop will go through each sheet of your workbook and hide the page break lines.
For doing practice by yourself we have provided a Practice section like below in a sheet named Practice. Please do it by yourself.
In this article, we tried to cover some of the ways to remove the dotted lines in Excel. Hope you will find it useful. If you have any suggestions or questions, feel free to share them in the comment section.