How do I remove LOTS of blank rows at once

  • Thread starter Thread starter brewster56
  • Start date Start date
Hi,

Right click your sheet tab, view code and paste this in and run it

Sub Kill_Blank_Rows()
Dim i As Long
For i = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(ActiveSheet.UsedRange.Rows(i)) = 0 Then
ActiveSheet.UsedRange.Rows(i).EntireRow.Delete
End If
Next i
End Sub

Mike
 
Worksheets("Sheet1").Rows(StartRowNumber).Resize(NumberOfRows).Delete

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
You are awesome - thank you very much both for the quick reply (saved my day)
and the fact that it worked first time and solved my problem
 
Glad I could help

brewster56 said:
You are awesome - thank you very much both for the quick reply (saved my day)
and the fact that it worked first time and solved my problem
 
Hi:

I copied it into view code, but i can't figure out how to "run it." can you
tell me how please?

thanks.

Jeff
 
Back
Top