Hide lines in excel

Show or hide gridlines on a worksheet

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 Excel 2007 Excel for Mac 2011 Excel Starter 2010 More…Less

Gridlines are the faint lines that appear between cells on a worksheet.

Worksheet in which gridlines are showing

When working with gridlines, consider the following:

  • By default, gridlines are displayed in worksheets using a color that is assigned by Excel. If you want, you can change the color of the gridlines for a particular worksheet by clicking Gridline color under Display options for this worksheet (File tab, Options, Advanced category).

  • People often confuse borders and gridlines in Excel. Gridlines cannot be customized in the same manner that borders can. If you want to change the width or other attributes of the lines for a border, see Apply or remove cell borders on a worksheet.

  • If you apply a fill color to cells on your worksheet, you won’t be able to see or print the cell gridlines for those cells. To see or print the gridlines for these cells, remove the fill color by selecting the cells, and then click the arrow next to Fill Color Button image(Home tab, Font group), and To remove the fill color, click No Fill.

    Note: You must remove the fill completely. If you change the fill color to white, the gridlines will remain hidden. To keep the fill color and still see lines that serve to separate cells, you can use borders instead of gridlines. For more information, see Apply or remove cell borders on a worksheet.

  • Gridlines are always applied to the whole worksheet or workbook, and can’t be applied to specific cells or ranges. If you want to apply lines selectively around specific cells or ranges of cells, you should use borders instead of, or in addition to, gridlines. For more information, see Apply or remove cell borders on a worksheet.

If the design of your workbook requires it, you can hide the gridlines:

Worksheet in which gridlines have been hidden

  1. Select one or more worksheets.

    Tip: When multiple worksheets are selected, [Group] appears in the title bar at the top of the worksheet. To cancel a selection of multiple worksheets in a workbook, click any unselected worksheet. If no unselected sheet is visible, right-click the tab of a selected sheet, and then click Ungroup Sheets.

  2. In Excel 2007: On the View tab, in the Show/Hide group, clear the Gridlines check box.

    Gridlines check box in Show/Hide group

    In all other Excel versions: On the View tab, in the Show group, clear the Gridlines check box.

    Options in the Show group on the View tab

If the gridlines on your worksheet are hidden, you can follow these steps to show them again.

  1. Select one or more worksheets.

    Tip: When multiple worksheets are selected, [Group] appears in the title bar at the top of the worksheet. To cancel a selection of multiple worksheets in a workbook, click any unselected worksheet. If no unselected sheet is visible, right-click the tab of a selected sheet, and then click Ungroup Sheets.

  2. Excel 2007: On the View tab, in the Show/Hide group, select the Gridlines check box.

    All other Excel versions: On the View tab, in the Show group, select the Gridlines check box.

Note: Gridlines do not print by default. For gridlines to appear on the printed page, select the Print check box under Gridlines (Page Layout tab, Sheet Options group).

  1. Select the worksheet.

  2. Click the Page Layout tab.

  3. To show gridlines: Under Gridlines, select the View check box.

    To hide gridlines: Under Gridlines, clear the View check box.

Follow these steps to show or hide gridlines.

  1. Click the sheet.

  2. To show gridlines: On the Layout tab, under View, select the Gridlines check box.

    Note: Gridlines cannot be customized. To change the width, color, or other attributes of the lines around cells, use border formatting.

    To hide gridlines: On the Layout tab, under View, clear the Gridlines check box.

Gridlines are used to distinguish cells on a worksheet. When working with gridlines, consider the following:

  • By default, gridlines are displayed on worksheets using a color that is assigned by Excel. If you want, you can change the color of the gridlines for a particular worksheet.

  • People often confuse borders and gridlines in Excel. Gridlines cannot be customized in the same way that borders can.

  • If you apply a fill color to cells on a worksheet, you won’t be able to see or print the cell gridlines for those cells. To see or print the gridlines for these cells, you must remove the fill color. Keep in mind that you must remove the fill entirely. If you simply change the fill color to white, the gridlines will remain hidden. To retain the fill color and still see lines that serve to separate cells, you can use borders instead of gridlines.

  • Gridlines are always applied to the entire worksheet or workbook and can’t be applied to specific cells or ranges. If you want to selectively apply lines around specific cells or ranges of cells, you should use borders instead of, or in addition to, gridlines.

You can either show or hide gridlines on a worksheet in Excel for the web. 

On the View tab, in the Show group, select the Gridlines check box to show gridlines, or clear the check box to hide them. 

Excel for the web works seamlessly with the Office desktop programs. Try or buy the latest version of Office now.

See Also

Show or hide gridlines in Word, PowerPoint, and Excel

Print gridlines in a worksheet

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Hiding gridlines in Excel is a common task and most Excel users should know about it. It makes your spreadsheet clean and presentable. Although grid lines in excel have their own benefits but in some cases, it is better to hide them.

What are Gridlines?

A spreadsheet contains cells and gridlines or grid bars represent the borders of these cells. Gridlines are the faint lines on your spreadsheet that help you to distinguish the cell boundaries.

What are gridlines ?
Uses of Gridlines

1. They make it easier for you to align text or objects by giving you a visual cue.

2. They help you to distinguish between cell boundaries.

3. They make your data-tables more readable especially when they are without a border.

Gridlines are hidden during printing but if you want you can show them explicitly.

Method 1: Hide Excel Gridlines Using the Option in the Ribbon

Excel has a default option to hide these mesh lines.

For Excel 2007 and Onwards

  • Navigate to the “View” tab on the Excel ribbon.

Gridlines_Option_in_Excel_Ribbon

  • Uncheck the “Gridlines” checkbox and the grid bars will be hidden.
  • Or you can also hide the grid lines from the “Page layout” and uncheck the Gridlines “View” option.

Gridlines_Option_in_Excel_2

For Excel 2003 and Earlier

  • Navigate to “Tools” > “Options”.

Gridlines_Option_in_Excel_2003

  • Now, a dialog box will open. Navigate to the “View” tab and then uncheck the “Gridlines” option and click ‘OK’. This will hide these annoying lines.

Method 2: Make Gridbars Invisible by changing Background Color

Another obvious way to hide the gridlines in excel is by changing their background color so that it matches the worksheet background. This can be done by using the following steps:

  • First of all, select all the rows and columns of the spreadsheet by pressing “Ctrl + A”. Alternatively you can also click the little triangle icon under the “Name box”.
  • With all the cells selected, click the “Fill Color” option and select the white color.

Gridlines_Gone_By_changing_background

  • Now, all the gridlines will be hidden.

Method 3: Hiding Gridlines by Using Excel Shortcut

If you are someone who loves to see a keyboard as compared to a mouse then here is the shortcut key for you. You can use the “Alt + WVG” key combination to hide the excel grid bars.

Method 4: Hide Spreadsheet Gridlines using a VBA Script

If you want to hide the gridlines by using a macro then you can use the below code. This code hides the gridlines if they are visible but if the gridlines are already hidden then it displays a message saying “Gridlines are already hidden!»

Sub Hide_Mesh()
If ActiveWindow.DisplayGridlines Then
ActiveWindow.DisplayGridlines = False
Else
MsgBox "Grid lines are already hidden!"
End If
End Sub

Hide Gridlines While Printing the Sheet

To hide the gridlines while printing the sheet follow the below steps:

  • Navigate to the “Page Layout” tab and uncheck the “Print” option under the Gridlines area. Or you can also use the “ALT + PPG” key combination to do this.
  • After this print, the spreadsheet and the gridlines won’t be visible.

How to Bring the Gridlines Back if they are Already Hidden

If your grid lines are invisible by default and you want to show them up, then just check back the gridlines option that we have unchecked in Method 1. Alternatively, you can also press the keys “Alt + WVG” to make the grid bars visible again.

So, this was all how to hide gridlines in excel. Do share your thoughts and ideas related to the topic.

Recommended Reading: How to create a Checkbox in excel

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 somethings 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.

So let’s get started!

Possible Reasons for 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 show page breaks as dotted lines
  2. Borders that have been set to show as dotted lines
  3. Gridlines that appear in the whole worksheet. These are not really dotted lines (rather faint solid lines that looks 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.

How to Remove Dotted Lines in Excel

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

Removing the Page Break Dotted Lines

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 line in the worksheet

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.

Here is a better way to remove these dotted lines:

  1. Click on the File tabClick on the File Tab
  2. Click on OptionsClick the Option buttin
  3. In the Excel Options dialog box that opens, click on the Advanced option in the left paneClick on Advanced option
  4. Scroll down to the section – “Display options for this worksheet”Scroll down to the display options for this worksheet section
  5. Uncheck the option – “Show page breaks”Uncheck show page breaks

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

Note that the above steps would stop showing the dotted lines only for the workbook in which you have unchecked this option. For other workbooks, you will have to repeat the same process if you want to get rid of the dotted lines.

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

Removing Dotted Lines Border

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

Something as shown below:

Dotted 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
  2. Click the Home tabClick the Home tab in the ribbon
  3. In the Font group, click on the ‘Border’ drop-downClick on border drop-down
  4. In the border options that appear, click on ‘No Border’Click on No Border to remove dotted lines

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.

Removing Gridlines

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:

  1. Click on the View tabClick on View
  2. In the Show group, uncheck the Gridlines optionUncheck 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 three ways you can remove the dotted lines in Excel.

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
  • 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)

Last Updated on August 16, 2022

Grid lines in Excel are incredibly useful, helping you distinguish between the different cells of a spreadsheet.
However, there may be times when you want to hide or otherwise get rid of the lines of the grid on your worksheet.

This guide will show you how to hide that grid line pattern on virtually any type of Excel worksheet.

What Are Grid lines In Excel?

Grid lines are the thin gray lines that separate cells from each other on a spreadsheet. These help a user differentiate between the various rows and columns in most spreadsheet programs, including Google Sheets and Microsoft Excel.

As we have already mentioned, grid lines are useful for keeping the alignments of rows and columns easily visible.
And there are a few methods that you can use for hiding the grid lines on the worksheet that you are currently using. Let’s go through them.

Using the Hide Option In Your Excel Ribbon

This is an option that you can use in virtually all versions of Microsoft Excel to hide grid lines in Excel – although where it is located varies between versions.

Excel 2007 – Present

In a modern version of the program, and dating back to 2007, Excel gives you the option to simply hide the grid lines in your ribbons at the top of the program.

All you need to do is simply press the ‘View’ tab, then select the option that says ‘grid lines’ in the ‘Show’ section. This will uncheck the grid lines from your spreadsheet.

Alternatively, you can also change the option in your ‘Page Layout’ tab, in the ‘Sheet Options’ Section.

Excel 2007 - Present

You can also choose whether the grid lines are visible in the printed version of a worksheet from this section.

Excel Version 2003 And Older

In this version, you need to navigate the program to ‘Tools’, then the ‘Options’ choice.

From here, a drop-down box will appear, giving you a range of options to modify. For our purposes, go to the ‘View’ tab of the new window, navigate to the ‘Window option’s section, and tick/untick the grid lines option.

Change The Color Of The Spreadsheet

It’s also possible for you to simply change the color of the page so that the grid lines match the color of the worksheet itself.

Below are the steps on how to change the color of the spreadsheets

Click The Fill Color Option

For this option, make sure that all the cells of the sheet are selected.

Then click the ‘Fill color’ option at the top of the ‘Home’ tab on the program ribbon.

Select White And The Entire Sheet Will Be A Single Color

Once you have done this, select white and the entire sheet will be a single color, including the grid lines.

Use VBA Script To Hide Spreadsheet Grid Lines

This option relies on modifying the code of Microsoft Excel by using a specific macro.

Below are the steps on using VBA Script to hide spreadsheet grid lines.

Press The View Code Button

For this option, you just need to press the ‘View code’ button on your keyboard whilst you are in Microsoft Excel.

Input Hide_Mech

Then by inputting ‘Hide_Mech’ you can hide the grid lines of a worksheet.

However, keep in mind that if you have already hidden the spreadsheet’s grid lines through some other means, the code window will state ‘Grid Lines are already hidden!’

Final Thoughts

As you can see, while some of the options we have mentioned can be a little complicated, there are plenty of ways for you to remove or add back the grid lines on your Excel worksheet.

  • Check out more of our guides on Excel for the best functions and top tips.

Home > Data Recovery > 2 Methods to Hide or Show Specific Lines in a Line Chart in Your Excel Worksheet

When there are many data series in a worksheet, the corresponding line chart will also be in a mess. In order to make the chart clearer, we have the two methods in this article.

The line chart in Excel can show data and information better. But with many lines in one chart, you will find it hard to check certain lines. In our previous article How to Create a Dynamic Line Chart with Checkboxes in Your Excel Worksheet, we have introduced a method to make the line chart better. And here we have found other two effective methods. Continue reading this article and see how these two methods take effect.

Method 1: Create a Pivot Chart

The pivot chart in Excel is very powerful. You can use it to fulfill many amazing tasks. And here we will show you the steps of using pivot chart to make the line chart better.

  1. Select the original range in the worksheet.
  2. And then click the tab “Insert” in the ribbon.
  3. After that, click the arrow button under the button “PivotTable”.
  4. In the drop-down menu, only two options are available. Here you need to choose the second option “PivotChart”.PivotChart
  5. After that, in the “Create PivotTable with PivotChart” window, set the location that you need to show the chart. Here we will choose a new worksheet.Location
  6. When you finish the setting of location, click the button “OK” in the window. Next you will directly come to the new worksheet with the pivot table and the pivot chart.
  7. In this worksheet, right click in the chart area.
  8. And then in the new menu, choose the option “Change Chart Type”.Change Type
  9. In the “Change Chart Type” window, you can see that the default chart type is column chart. Here you need to choose the line chart in this window.Line Chart
  10. After that, click the button “OK” in the window.
  11. Now you will also come back to the worksheet. Here you can check the fields in the “Choose fields to add report” area. The field “Date” needs to be always checked. As for other products, you can check them according to your actual need.Choose Field

Therefore, you can see that using the pivot chart can save you a lot of time and energy. Therefore, the next time you can consider using this method.

Method 2: Use VBA Macros

If you don’t want to create another worksheet or a new pivot table in your worksheet, you can use the VBA macros in the file. Also here you need to combine the VBA macros with the check boxes for the line chart. Before you use the macros, you need first arrange the worksheet.

  1. In the original worksheet, create the line chart for the data and information.
  2. And then click the tab “Developer” in the ribbon. If there is no such a tab, you need to add it in the “Excel Options” window.
  3. Next click the button “Insert” in the toolbar.
  4. After that, choose the “Check Box” in the drop-down menu.Checkbox
  5. And then click in the chart area. Therefore, you have inserted a new check box in the worksheet.
  6. Next right click the check box.
  7. In the pop-up menu, change the text into the name of the product “DataNumen Excel Repair”.
  8. Next adjust the width of the check box so that it can show the whole phrase.Edit Text
  9. Repeat the step 2-8 and insert other check boxes for other products. You need to insert the number of check boxes and change their names according to your need.
  10. Ans then in this step, press the button “Ctrl” on the keyboard and hold it.
  11. Next use your mouse to select all the check boxes in the chart.
  12. After that, you can release the button “Ctrl”.
  13. And then click the tab “Format” in the ribbon.
  14. After that, click the button “Align” in the toolbar.
  15. In the drop-down list, choose the options and align those check boxes. Here we will choose “Align Left” and the “Distribute Vertically” in the menu.Align
  16. Next, press the “Ctrl” again.
  17. And then click the line chart. After that, you can also release the button.
  18. After that, click the button “Group” in the toolbar.
  19. In the drop-down list, still click “Group”. Therefore, you have grouped those check boxes with the line chart.Group
  20. When you finish the setting in the chart, you need to use VBA macros. Here press the button “Alt +F11” on the keyboard to open the Visual Basic window.
  21. And then insert a new module in the editor.Insert Module
  22. In this step, copy the following codes into the new module.
Sub HideShowLine()
  Application.ScreenUpdating = False
  Dim i As Integer
  For i = 1 To 5
    If ActiveSheet.CheckBoxes("Check Box " & i).Value = -4146 Then
      ActiveSheet.ChartObjects("Chart 1").Activate
      ActiveChart.SeriesCollection(i).Format.Line.Visible = msoFalse
    Else
      ActiveSheet.ChartObjects("Chart 1").Activate
      ActiveChart.SeriesCollection(i).Format.Line.Visible = msoTrue
    End If
  Next i
End Sub

Sub AssignMacro()
  Application.ScreenUpdating = False
  Dim i As Integer
  For i = 1 To 5
    ActiveSheet.Shapes.Range(Array("Check Box " & i)).Select
    Selection.OnAction = "HideShowLine"
  Next i
End Sub

There are two macros. The first will hide or show lines according to the condition of the corresponding check boxes. And the second is to assign the first macro to those check boxes. You need to change certain elements in the codes, such as the numbers of the lines, and the name of the chart.

  1. And then you need to run the second macro. Click in the area of the second macro and press the button “F5” on the keyboard to run it.

Next you can come back to the worksheet. When you check or uncheck the check box, you will see the corresponding lines in the chart.Result

This method is also very useful. In your actual worksheet, you can also have a try.

A Comparison of the Methods

In this part, we will make a comprehensive comparison of the three methods. And the other method is in the article How to Create a Dynamic Line Chart with Checkboxes in Your Excel Worksheet.

Comparison

Create a Pivot Chart Use VBA Macros

Use Check Boxes

Advantages

This method is very easy to use. And you don’t necessarily need to know the VBA or other functions. The VBA codes can also be used in other worksheets. You only need to modify certain elements in the codes. When you don’t know VBA macros and you want to show the result in this ordinary line chart, you can use this method.

Disadvantages

This method will create the pivot table together with the pivot chart. If you don’t want to create an additional pivot table, you can use other methods. If you are not familiar with Excel VBA, you will probably meet with problems when changing or running the macros. This method will actually add a new range in the worksheet. And this will mess up your worksheet.

All the methods have their advantages and disadvantages. When you need to hide or show lines in a line chart, you can choose one method according to your actual need.

Focus on the Privacy and Security in Excel

In your Excel, not only will there be the data and information that you manually input, but also there will be some private information. This private information is essential. Therefore, you need to pay special attention to your files. Sometimes your files will be damaged by virus or the malicious malware. The result can be very series. Your personal information in the worksheet will be known by someone else. Besides, the data and information will also be damaged. At this moment, you can use a third-party tool to repair Excel xlsx file error. With this tool at hand, you can well protect your important files.

Author Introduction:

Anna Ma is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including repair Word docx problem and outlook repair software products. For more information visit www.datanumen.com

Like this post? Please share to your friends:
  • Hexadecimal to decimal in excel
  • Hide line in excel
  • Hex2dec excel где находится
  • Hide line break word
  • Hex to word delphi