6 Ways to Remove Blank Rows in Excel (Step-by-Step)
Clearing out blank rows in Excel can make your data more concise and organized. Here are six straightforward methods to remove blank rows:
Method 1: Using Filters
- Click on the filter icon in any of the column headers.
- In the filter dropdown, uncheck the box next to
(Blanks)
to show only non-blank rows. - Select the visible rows by clicking on the row numbers (left side) to highlight them.
- Right-click on the selected rows and choose
Delete
. - Confirm the deletion by clicking
Delete Sheet Rows
.
Method 2: Using Go To Special
- Press
Ctrl
+G
orF5
to open the Go To dialog box. - Click on the
Special
button. - Choose
Blanks
and clickOK
. - The blank cells will be selected.
- Right-click on any selected cell and choose
Delete
. - Confirm the deletion by clicking
Delete Sheet Rows
.
Method 3: Using VBA Macro
- Press
Alt
+F11
to open the VBA Editor. - Click
Insert
>Module
to insert a new module. - Copy and paste the following VBA code:
Sub RemoveBlankRows()
Dim ws As Worksheet
Dim rng As Range
Dim i As Long
Set ws = ActiveSheet
Set rng = ws.UsedRange
For i = rng.Rows.Count To 1 Step -1
If Application.WorksheetFunction.CountA(rng.Rows(i)) = 0 Then
rng.Rows(i).Delete
End If
Next i
End Sub
- Press
F5
to run the macro. It will remove all blank rows in the active sheet.
Method 4: Using Excel Table (ListObject)
- Convert your data range into an Excel Table by selecting any cell within the range and pressing
Ctrl
+T
. - Click the filter dropdown arrow in any column header.
- Uncheck the box next to
(Blanks)
to display only non-blank rows. - Right-click on any selected row header and choose
Delete
.
Method 5: Using Power Query
- Select your data range.
- Go to the
Data
tab on the ribbon. - Click on
From Table/Range
to open Power Query Editor. - In Power Query, filter out blank rows.
- Click
Close & Load
to update your Excel worksheet.
Method 6: Using Remove Duplicates
- Select your data range.
- Go to the
Data
tab on the ribbon. - Click on
Remove Duplicates
. - Check the box next to all columns to remove duplicates (including blank rows).
- Click
OK
to remove duplicates and blank rows.