Delete all blank rows

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
My first time using a spreadsheet. I need a way to select and delete all blank rows, never knowing the number of rows there will be. I want to remove all rows with no data that are located between rows with data.

Thanks for any help.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

rollo

New Member
Joined
Feb 15, 2002
Messages
43
Click on one of the column letters at the top of the worksheet, so that the whole column is highlighted.
Then, from Edit>Go To>Special>Blanks>OK
(All the blank cells in the column will be highlighted)
Lastly, from Edit>Delete>Entire rows
 

Asala42

Well-known Member
Joined
Feb 26, 2002
Messages
2,318
Can you use the data (or lack of data) in one of your columns as the basis of an empty row? If you can, this bit of code might get you started:

Code:
Sub DeleteBlankRows()
Sheets("Sheet1").Activate

Lastrow = Range("A65536").End(xlUp).Row

For i = Lastrow To 1 Step -1
    Cells(i, 1).Activate
    If ActiveCell.Value = "" Then
        Rows(i).Delete
    End If
Next i
End Sub
 

Forum statistics

Threads
1,143,915
Messages
5,721,506
Members
422,369
Latest member
redinator

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top