2007, removing blank rows

Jeffrey Green

Well-known Member
Joined
Oct 24, 2007
Messages
1,021
Grrrrr,

I have several sheets with about 250,000 rows per sheet.

But, even I sort by Column A, there are STILL hundreds or rows that are totall blank interspersed down the page . . . I can't autofilter for blanks because there is too much data . .

How can I get rid of them?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
This will delete rows if cell in column "A" is blank
Always try code on a test sheet first
Code:
Sub delrow()
Dim lr As Long, r As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
    For r = lr To 1 Step -1
        If Range("A" & r).Value = "" Then Rows(r).Delete
    Next r
End Sub
 
Upvote 0

Forum statistics

Threads
1,207,093
Messages
6,076,545
Members
446,212
Latest member
KJAYPAL200

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
Back
Top