Gridlines serve as valuable tools for distinguishing and organizing data cells in Google Sheets. When working with large tables or extensive amounts of data, gridlines can be especially beneficial. In this article, we will explore three easy methods to add or remove gridlines in Google Sheets.
Method 1: Use the View Menu to Add or Remove Gridlines
The simplest way to remove or add gridlines in Google Sheets is by utilizing the View menu. By toggling the gridlines option, you can easily hide or display them. Follow these steps to adjust the gridlines:
Step 1: Open your relevant worksheet in Google Sheets.
Step 2: Click on the “View” option in the menu bar.
Step 3: Select “Show” from the dropdown menu and choose “Gridlines.”
This will enable the display of gridlines in your Google Sheets file. If you wish to disable the gridlines, simply repeat the above steps and uncheck the “Gridlines” option from the View menu. This will remove the gridlines from the entire worksheet.
Tip: If you only want gridlines to appear in a specific section of your sheet, you can add borders to those areas instead. Just select the desired range of cells and click on the borders icon.
Method 2: Use an Apps Script to Control Gridlines
With the help of an Apps Script, you can create custom function commands for Google Sheets. This allows you to integrate your sheet with other Google services such as Docs and Calendar. To view or eliminate gridlines using an Apps Script, follow these steps:
Note: The Apps Script command created here will be bound to the document it was initially created for. If you want to use this command for other sheets, you will need to recreate it using the Apps Script menu of that specific sheet.
Step 1: Open your Google Sheets file and click on “Extensions.”
Step 2: Select “Apps Script” from the dropdown menu.
Step 3: Once the Apps Script window appears, copy and paste the following script into the code editor section:
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);
};
};
Step 4: Click on “Save project” and run the script.
Step 5: Return to your worksheet and type “TRUE” in cell A1 to hide the gridlines.
Note: To remove gridlines, type “FALSE” instead.
By utilizing this method, you can automatically trigger Google Sheets to show or remove gridlines.
Method 3: Customize Gridline Visibility for Printing
Although gridlines are helpful during the working process, you may prefer not to have them visible when printing the sheet. This is where Google Sheets’ print settings can be of assistance. Here’s how you can hide or show gridlines using the print settings:
Note: The following steps only remove gridlines from Google Sheets. If you have added borders to the cells, you will need to remove them before printing the sheet.
Step 1: Open the relevant sheet and click on “File.”
Step 2: Scroll down and select the “Print” option.
Alternatively, you can use the keyboard shortcut Control + P (Windows) or Command + P (Mac) to open the print settings.
Step 3: Click on the “Formatting” tab in the print settings bar.
Step 4: Uncheck the “Show gridlines” option.
Step 5: Click on “Next.”
Once completed, follow the onscreen instructions to print your sheet without gridlines. If you want gridlines to be visible while printing, simply follow the aforementioned steps and check the “Show Gridlines” option on the Formatting tab. This will allow the gridlines to appear in the printed version of your Google Sheets file.
Tip: For troubleshooting printing issues with your Google Sheets files, you can refer to our article to resolve any problems.
FAQs for Using Gridlines in Google Sheets
Manage Gridlines in Google Sheets
We hope this article has helped you gain a better understanding of how to add or remove gridlines in Google Sheets. For further information on formatting tables in Google Sheets, we invite you to read our other article.