3 Ways to Show or Hide Gridlines in Google Sheets

This post is going to show you all the different ways to show or hide gridlines in Google Sheets.

Google Sheets contains gridlines surrounding each cell throughout each sheet. These gridlines are light gray and connect the worksheet’s rows and columns.

Grid lines help you to see the data clearly and distinguish between different cells in the worksheet. Perhaps you don’t need the grid lines in the final report or when you print the page. In this case, you will want to hide the gridlines.

In this post, you will learn the different methods you can use to hide or show gridlines in Google Sheets and also learn how to print the data without gridlines.

  • Show or Hide Gridlines from the View Menu
  • Show or Hide Gridlines when Printing the Sheet
  • Show or Hide Gridlines with an Apps Script

Download a copy of the sample workbook using the above link to follow along with the post.

Show or Hide Gridlines from the View Menu

Details about the income and expenses for a whole year are included in the above sample data table.

You can see throughout the sheet there is a light gray border around each cell. These are the gridlines.

Follow these steps to show or hide gridlines in Google Sheets.

  1. Select the View from the menu.
  2. Click on the Show option.
  3. Select the Gridlines option from the menu items that appear.

This will deactivate the settings for Gridlines. The worksheet’s entire grid will be cleared out using the above steps.

In Google Sheets, the gridlines option functions work as a toggle button. The gridlines in the worksheet will return if you repeat the previous steps and click on the Gridline option.

Show or Hide Gridlines when Printing

Gridlines can be very helpful to you while working in your worksheets, but you might not want to have these printed.

While printing the worksheet, you can alter a setting in Google Sheets so that any gridlines do not show.

Follow these steps to show or hide gridlines in Google Sheets while printing.

1. Select the range you need to print.

You can also make no selection or select the entire used range if you need to print the entire worksheet.

  1. Go to the File menu.
  2. Select the Print option or use the keyboard shortcut Ctrl + P to open the Print settings menu.
  1. Select your range in the Print Dropdown.

You should see your selected range Selected cells (B5:D17). You can also choose the Current sheet to print the entire sheet.

  1. Click the Formatting option on the Print Settings page in right-side pane.
  2. Deselect the Show Gridlines check box.

The above steps will hide the gridlines while printing the table. Even though gridlines are included in the worksheet they won’t appear in the printed result.

💡 Tip: Make sure you remove the gridlines when you email your document as a PDF for a more professional look!

Show or Hide Gridlines with an Apps Script

Apps script is a tool that can help you to automate your tasks in Google Sheets.

You can use apps scripts to show or hide the gridlines automatically based on a user’s actions.

For example, you could set up a checkbox in the grid that allows the user to toggle on or off the gridlines without ever using the menu bar commands.

Check out this full guide to apps scripts in Google Sheets for more details on this amazing automation tool.

Follow these steps to open the apps script code editor window.

  1. Go to the Extensions menu.
  2. Click on the Apps Script option.
function onEdit(e) {
  var mySheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var myRange = e.range;
  var mySheetName = mySheet.getSheetName();
  var myStatus = myRange.getValue();
  var currRow = myRange.getRow();
  var currCol = myRange.getColumn();
  if (
    currRow === 1
    && currCol === 1
  ) {
    mySheet.setHiddenGridlines(myStatus);
  };
};
  1. Copy and paste the above script into your Google Sheet code editor.
  2. Click the Save button.

The above script will automatically execute whenever you change the value in the first cell A1 to either TRUE or FALSE in your active sheet in Google Sheets.

If you give anything other than a TRUE or FALSE value in cell A1, it will not pop up any error message and will retain the previous gridlines status.

💡 Tip: Use a Checkbox in the cell to easily toggle between TRUE and FALSE values.

Go to the Insert menu and select Checkbox from the options to insert a checkbox in the cell.

The checkbox object creates a TRUE value in the cell when checked and a FALSE value when unchecked.

This is a great user friendly way to trigger the script and show or hide the gridlines.

Add Cell Borders

The gridlines in Google Sheets are very light gray and can be hard to see.

You can use cell border format to create a more visible gridline in your worksheets.

You may want to add borders to your data table in Google Sheets to help distinguish the data from other cells.

 Follow these steps to add borders to your selected cells.

  1. Select the range to which you need to apply a border.
  2. Select the Borders button in the toolbar.
  3. Select the All borders option from the sub menu.

Now your selected cells will have a more prominent gridline color that will make them stand out from the rest of the grid.

💡 Tip: There are also options in the Borders menu for changing the border color in case you don’t want to use the default black color.

Conclusions

Light gray gridlines appear in every worksheet by default, but you can easily remove them.

The View menu has options to display your reports without gridlines and this allows you to toggle on or off the gridline view.

There are also options in the Print Settings for printing your report without gridlines, while retaining the gridlines in your worksheet.

Showing or hiding the gridlines can also be automated with apps scripts in your reports without manual interaction in the View menu.

Another option is using the cell border format to enhance the look of your gridlines for certain sections of the worksheet.

Do you use any tips to show or hide gridlines in Google Sheets? Do you know any other methods to show or hide gridlines? Let me know in the comments below!

About the Author

Arnold Layne

Arnold Layne

Arnold is a Google Workspace certified consultant and Google Sheets expert. He has over 15 years of experience in the IT industry and specializes in helping businesses implement and use Google products to increase efficiency and productivity. He is an avid traveler, and loves exploring new cultures and learning about different ways of life.

Related Articles

Comments

0 Comments

Get the Latest Google Sheets Tips

Write For Us

Are you a tech enthusiast with a talent for writing great content? Come write for us!

Follow Us

Follow us on social media to stay up to date with the latest in Google Sheets!