How to Delete Blank Rows in Excel 2016/2010

This post will guide you how to delete blank or empty rows or rows that contain blank cells in excel. If you want to remove blank rows that contain blank cells, you can use the Go To Special command. But if you just want to remove rows that are entirely blank, you should use the Filter blanks cell way.

Delete rows that contain blank cells

You can use the Go To Special command to remove all rows that contain blank cells, just do the following:

1# on the HOME tab, click Find & Select command under Editing group

2# click Go To Special

delete blank rows1

3# Select Blanks radio button and then click OK button.

delete blank rows2

4# you will see that all rows that contain blank cells are selected.

delete blank rows3

5# go to HOME tab, click Delete command under Cells group. Then click Delete Sheet Rows from the drop down menu list.

delete blank rows4

delete blank rows5

Delete Blank Rows

If you want to remove blank rows in excel, and you need to find the entire blank rows firstly, so you can use the Filter function to filter all blank rows, just do this following:

1# select the range of cells that you want to remove blank rows

delete blank rows6

2# on the DATA tab, click Filter command under Sort& Filter group.

delete blank rows7

3# click Filter arrow button and uncheck the Select All box, just check only Blanks, then all blank rows in that column will be filtered.

delete blank rows8

delete blank rows9

4# you need to continue to filter other columns for blank cells until all cells in the selected range are blank.

delete blank rows10

5# select all the filtered rows, go to HOME tab, click Delete command under Cells group. Then click Delete Sheet Rows from the drop down menu list.

delete blank rows11

Or just right-click on the selected cell and then click Delete Row from the drop-down menu list.

delete blank rows12

delete blank rows13

6# on the DATA tab, click Clear command under Sort & Filter group.

delete blank rows14

7# you will see that all blank rows are removed.

delete blank rows15

Delete blank rows in Excel VBA

You can also write an excel Macro to delete blank rows in excel, just refer to the following steps:

1# click on “Visual Basic” command under DEVELOPER Tab.

Get the position of the nth using excel vba1

2# then the “Visual Basic Editor” window will appear.

3# click “Insert” ->”Module” to create a new module

convert column number to letter3

4# paste the below VBA code into the code window. Then clicking “Save” button.

delete blank rows16

Sub RemoveBlankRows()
    Dim Rng As Range
    Dim WorkRng As Range
    On Error Resume Next
    xTitleId = "Remove blank rows"
    Set WorkRng = Application.Selection
    Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
    xRows = WorkRng.Rows.Count
    Application.ScreenUpdating = False
    For i = xRows To 1 Step -1
        If Application.WorksheetFunction.CountA(WorkRng.Rows(i)) = 0 Then
            WorkRng.Rows(i).EntireRow.Delete XlDeleteShiftDirection.xlShiftUp
        End If
    Next
    Application.ScreenUpdating = True
End Sub

5# back to the current worksheet, then run the above excel macro.

delete blank rows17

delete blank rows18

 

Comments

So empty here ... leave a comment!

Leave a Reply

Your email address will not be published. Required fields are marked *

Sidebar