How to Delete Row If Cell Is Blank in Excel?

Removing rows in Excel when a cell is empty helps to clean up your data, making it easier to work with and understand. It also keeps your Excel file size smaller, making it faster. This process is useful for keeping your data accurate and organized, especially when preparing charts or moving data between different programs.

In this Excel tutorial, you will learn to delete rows if the cell is blank with 4 easy methods. These methods will include some of Excel’s built-in features and VBA code.

In the following image, you can see we have some rows with blank cells. It also shows the result after deleting those rows with blank cells.

Overview image of delete row row if cell is blank

To delete rows if the cell is blank, here are the 4 methods:

Using Go To Special Command

Go To Special in Excel is a feature that allows you to quickly select specific types of cells, such as blanks, formulas, or constants, for efficient editing and organizing. This method is highly efficient for deleting rows with any blank cells, as it easily identifies and selects all blanks in a dataset, saving significant time and reducing errors in large datasets.

To delete rows if the cell is blank with the Go To Special command, follow these steps:

  1. Select the whole data
  2. Then go to Home tab > Editing group > Find & Select > Go To Special.
    Open Go To Special dialog box
    Go To Special dialog box will appear.
  3. From the Go To Special dialog box, select Blanks. Then click OK.
    Go TO Special dialog Box
    After that, the blank cells will be highlighted.
  4. Select any of the blank cells and right-click on it. Now, click on Delete.
    Delete dialog box will appear.
  5. Now, select Entire row and click on OK.

Finally, you will see all the rows that have blank cells will be deleted.

Final output

Using Find and Replace Feature to Identify Rows and Delete Those

Find and Replace in Excel is a feature that allows you to search for specific content within a worksheet and replace it with different content. Unlike the ‘Go To Special’ method, which directly selects blank cells for deletion, Find and Replace can be used to initially mark or fill blank cells with a specific value or text, making them easier to identify.

To delete rows if the cell is blank using Find and Replace Feature, follow these steps:

  1. Select all the data.
  2. Press Ctrl+F on your keyboard.
    After that, you will see a Find and Replace dialog box.
    Find and Replace dialog box
  3. Click on Options.
  4. Now, from the Find and Replace Dialog box:
    • Leave it empty in the Find What box
    • Select Match entire cell contents.
    • Select Values from the Look in dropdown menu.
    • Click on Find All.

    working in find and replace dialog boxIt will bring up the lists of all those rows containing blank cells on them

  5. Press Ctrl+A to select all those rows.
    select all the rows
  6. It will highlight all those blank cells.
  7. Similar to the previous method, right-click on a blank cell. Click on Delete > Entire row > OK.
    delete entire row

After that, it will delete all those rows having blank cells.

output image

Filtering Rows with Blank Cells and Deleting Those

In this method, you add a temporary column (helper column) to identify rows with blank cells using a formula, and then filter and delete these rows based on the criteria set in the helper column.

Deleting rows with blank cells when you need specific control over which rows to remove, especially in complex datasets where reviewing rows before deletion is necessary.

Follow these steps to filter rows if the cell is blank and delete those:

  1. Create a Helper column.
    creating helper column
  2. Now, in the Helper column:
    • Write the formula: =IF(COUNTBLANK(B7:E7),”Blank”,”Not Blank”)
    • Press Enter.
    • Drag down the Fill Handle.

    Insert formula

  3. Now, go to the Data tab > Sort & Filter group > Filter.
    click on filter icon
  4. Click on the Dropdown of the Helper column. Then, select Blank.
    Filter rows with blank cells
    You will see the rows that have blank cells.
    Filtered rows
  5. Select these Rows and right-click on your mouse. Click Delete Row.
    Delete rows with blanks

After that, it will remove all the rows if any cell is blank in Excel.

Final output of filtering rows and delete

Read More: How to Delete Rows in Excel with Specific Text?

Using VBA

Using VBA to delete rows with blank cells is beneficial as it allows for automation of the process, making it highly efficient for repetitive tasks and customizable to handle complex criteria across large datasets.

To delete rows if the cell is blank using VBA, follow these steps:

  1. Go to the Developer tab.
  2. Click on Visual Basic.
    click on visual basic
  3. Now, select Insert > Module.
    Insert module
  4. In the code editor, insert the following code:
    Sub RemoveRows()
    On Error Resume Next
    Range("B6:E15").SpecialCells(xlBlanks).EntireRow.Delete
    
    End Sub
  5. Now, click on Run or you can press the F5 button.

After that, all the rows containing blank cells will be deleted.

delete row using VBA

Download Practice Workbook

Download the following practice workbook and practice along with that.

Conclusion

In conclusion, Excel offers several efficient methods like ‘Go To Special’, ‘Find and Replace’, using a helper column, and VBA scripting to delete rows if a cell is blank. These methods help keep your spreadsheets clean and organized, whether you’re working with small or large amounts of data. Leave us a comment if you find this article helpful and also check our website Exceldemy.

Frequently Asked Questions

How Do I Remove Blank Cells From Rows in Excel?

To remove blank cells from rows in Excel, you can follow these steps:

  1. Select the range where you want to delete rows.
  2. Go to the “Home” tab, click “Find & Select” in the editing group, then choose “Go To Special“.
  3. Select “Blanks” and click “OK”.
    This highlights all blank cells in the selected range.
  4. Right-click on one of the highlighted cells, choose “Delete”, then “Shift cells up“.

How Do I Remove Blank Cells From a Column?

In the selected column, use “Go To Special” > “Blanks”, right-click on highlighted cells, and choose “Delete” > “Shift cells up” to remove blank cells and shift the remaining cells up.

Can I Recover Rows After I’ve Deleted Them in Excel?

Rows can be recovered immediately after deletion using the Undo function (Ctrl + Z). However, once the workbook is saved and closed, it’s not possible to recover the deleted rows without a previous backup.


Related Articles


<< Go Back to Delete Multiple Rows Based on Condition | Delete Rows | Rows in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
A.N.M. Mohaimen Shanto
A.N.M. Mohaimen Shanto

A.N.M. Mohaimen Shanto, a B.Sc. in Computer Science and Engineering from Daffodil International University, boasts two years of experience as a Project Manager at Exceldemy. He authored 90+ articles and led teams as a Team Leader, meticulously reviewing over a thousand articles. Currently, he focuses on enhancing article quality. His passion lies in Excel VBA, Data Science, and SEO, where he enjoys simplifying complex ideas to facilitate learning and growth. His journey mirrors Exceldemy's dedication to excellence and... Read Full Bio

2 Comments
  1. Great methods, thank you for publishing them!

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo