How to Delete Highlighted Cells in Excel & Google Sheets
Written by
Reviewed by
Last updated on December 9, 2022
This tutorial demonstrates how to delete cells highlighted with a fill color in Excel and Google Sheets.
You can either delete rows with a specific background color using VBA, or you can filter your Excel worksheet by the color then delete the selected rows.
Filter by Color and Delete Selected Rows
- Click in the data where the cells/rows you want to remove are situated.
- In the Ribbon, select Home > Editing > Sort & Filter > Filter.
OR
Press CTRL + SHIFT + L on the keyboard.
- Filter drop-down lists appear at the top of each column of data in the selected data. Select (1) one of the drop-down lists available in the column headers and then (2) select Filter by Color. Finally, (3) select the color you wish to filter on.
These are the rows you are going to remove.
- Select the rows by clicking on the header of the first row to remove and dragging down to the last row you wish to remove, then, in the Ribbon, select Home > Cells > Delete > Delete Sheet Rows.
- The rows are removed. To clear the filter, select the filter button in the column you filtered on, and clear the filter from that column.
The remaining data is shown.
Sort by Color and Delete Selected Rows
- Click in the data to be sorted, and then, in the Ribbon, select Home > Editing > Sort & Filter > Custom Sort.
- Remove the (1) check mark from My data has headers, and then (2) select the column to sort by. Amend the Sort On to (3) Cell color and under Order (4) select the color of the cells you wish to remove.
- The rows are sorted to the top of the list. Select the rows by clicking on the header of the first row to remove and dragging down to the last row you wish to remove, then, in the Ribbon, select Home > Cells > Delete > Delete Sheet Rows.
Delete Highlighted Cells in Google Sheets
- You can also remove highlighted cells in Google Sheets by filtering by color.
- In the Data menu, select Create a filter.
- Then, (1) in the drop-down list of one of the column headers, select (2) Filter by color and then (3) select Fill Color and (4) select the color of the cells you wish to remove.
- Select the rows of the filtered data and then (1) in the Edit menu, select (2) Delete and (3) Selected rows.
The filter is automatically removed, and the remaining data is shown.