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)
 
ASAP utilities is an free add-in that has a tool to delete blank rows and
columns
 
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
 
You should NOT start a new thread. Stay in the old one. Here's another you
may prefer IF the blanks are col A
Sub DeleteBlanks()
Columns("A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
If you're new to macros, you may want to read David McRitchie's intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top