Do you need to delete rows in Google Sheets?
If so, this blog post is for you. We’ll show you how to delete rows in Google Sheets quickly and easily.
Deleting rows is a common task. There are many reasons why you might need to delete rows of data in Google Sheets.
Perhaps you have duplicate data that you want to get rid of, or maybe you just want to tidy up your spreadsheet and delete any unused rows.
Whatever the reason, deleting rows in Google Sheets is a fairly straightforward process. This post will show you the simple steps to deleting rows like a pro in no time.
Get your copy of the example workbook with the above link and follow below to learn how to delete rows in Google Sheets!
Delete Rows from the Edit Menu
Most every command to edit your workbook can be found in the Edit menu. This includes deleting rows.
Follow these steps to delete a row.
- Select a cell in the row to delete.
- Go to the Edit menu.
- Select Delete.
- Select Row from the available options.
The Delete menu is contextual so the menu items you see will depend on what cell or range of cells you have selected in your sheet. In this example, Row 3 appears as the Row option available since a cell in row 3 was selected.
The Edit menu comes with many options for deleting.
Once you go to the Edit menu and select the Delete command, you will get the following submenu options.
- Values This is used to delete the cell’s content or the selected cell’s value.
- Row * (Row with its number) This is used to delete the row in the selection, you don’t need to select an entire row to delete a row.
- Column * (Column with its letter) This is used to delete the column of the selected cell.
- Cells and Shift Up Deletes the cells and covers the space by shifting cells up.
- Cells and Shift Left Deletes the cell and covers the space by shifting cells to the left
- Notes Removes the note in the cell selection but leaves everything else intact.
Here are all the Delete options available.
- Values: Only the cell content or cell value of the selected cell E5 will be deleted. The cell color and border remain as is.
- Row: This option will delete the entire row 5 selection from the spreadsheet and will automatically adjust the remaining rows by shifting them up.
- Column: It will delete the entire column in the selection. Cell D3 is in the selection, if you select the column option it will delete column D and shift Column E to the Left.
- Cells and shift up: This will delete the selected cell and shift cells upward.
- Cells and shift left: This option will shift the adjacent cell of the deleted column to the left.
- Notes: This will delete any note inside the cell or cells. When a cell has a Note, an indicator appears in the corner of the cell. When you hover your cursor over the cell, the Note text will appear.
Notes will help you to communicate effectively with users of the spreadsheet as you can add whatever comments you want in a note for any purpose.
To delete any Notes, you can choose the Note option from the Delete submenu of the Edit menu.
If you don’t want to delete your data, you could hide the rows in your Google Sheets as an alternative. This will remove it from view but it can then be accessed later by unhiding the rows.
Delete Rows from the Right-Click Menu
Delete row is also an option in the right-click menu from your spreadsheet.
When deleting an entire row from the spreadsheet you don’t need to highlight or select the entire row, you can just select a cell, right-click on the selection and choose the option to delete.
When you click the Delete row option then the entire row in the selection will be deleted from the spreadsheet.
Follow these steps to delete a single row from your Google Sheet.
- Select the cell of the row to be deleted or you can select the entire row as well.
- Right-click on the selected cell to open the context menu
- Choose Delete Row from the list of options.
The selected row will be deleted!
You can also delete multiple rows at once.
Multiple adjacent rows can be deleted at the same time if adjacent cells are selected, if you wish to delete alternate rows then you will have to select or highlight the entire row.
In this example, cell A2 and A3 is in the selection and when you right-click on the selection delete row option will now have the option to Delete rows 2 -3.
But If you select alternate cells, the context menu will not have an option for deleting rows. Deleting alternate rows you will have to select the entire rows, and then you will have access to the Delete Selected Rows option.
Delete Rows with a Keyboard Shortcut
If you are a keyboard person and good at remembering shortcuts, here you have various options to delete rows using the following key combinations.
These will depend on the operating system and browser you use.
- For Chrome, you can use Alt + E, D to delete rows.
- For any other browser such as Edge, Firefox, or Safari use Alt + Shift + E, D to delete rows.
You can also use Ctrl + Alt + - and it will give you all delete options available in the menu and you can select whatever option you require.
In addition to these shortcuts, you can select an entire row with the keyboard shortcut Shift + Space.
Delete Rows with an Apps Script
When organizing your work, you might set up a to-do list of tasks so that you don’t miss any items.
But sometimes maintaining tasks or to-do lists can become time-consuming
If you have a lot of line items. Instead of manually deleting tasks from your list as you complete them you can set up a checkbox which automatically deletes the row when checked.
This can be automated with a Google Sheets apps script!
Here is a task list using checkboxes. Whenever a checkbox is marked, the row will be deleted with the help of the app script.
You can write the script if you are familiar with the code in Apps Scripts, or else you can directly copy and paste the script code into the Apps Script environment.
Go to the Extensions menu and select Apps Script from the options to open the app script editor.
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 (
mySheetName === 'Tasks'
&& currCol === 1
) {
if (
myStatus
) {
mySheet.deleteRows(currRow,1);
}
};
};
Copy and paste the above code into the apps script editor and press the Save button.
Make sure to set your sheet name in the code to whatever sheet your task list is on. This script has used MysheetName === 'Tasks'
since the list is in a sheet named Tasks.
Now you can delete rows automatically with the checkbox!
Conclusions
Deleting rows in Google Sheets is easy and there are a couple of different ways to achieve this result.
You can delete rows from the Edit menu, the right-click menu, or with a keyboard shortcut.
It’s also possible to delete rows automatically using an app script. This can help make the process more user-friendly.
Before deleting any row make sure that the row is not used elsewhere, as deleting a row can affect formulas and charts that reference the data in the deleted columns and rows.
If you accidentally delete rows containing data, you can retrieve the deleted rows by using the undo feature.
I hope you’ve found this guide on how to delete rows in Google Sheets helpful. If you have any suggestions for removing rows in Google Sheets, please feel free to share them with me in the comments section below!
0 Comments