Deleting the empty rows in Excel

  • Thread starter Thread starter lbrrenga
  • Start date Start date
L

lbrrenga

Hi All,

I need your help to delete (at one single step) all empty rows in the
spread sheet. Can you please help me?

Thanks

Regards
Renga
 
Hi lbrrenga

Emty rows or all rows with a empty cell in a column ?

There are examples on this page
http://www.rondebruin.nl/delete.htm

Use the Loop examples and read the tips below the three macros

You can use

If Application.CountA(.Rows(Lrow)) = 0 Then .Rows(Lrow).Delete
'This will delete the row if the whole row is empty (all columns)
 
Ron/lbrrenga

Your loop suggests a limited number of rows under variable EndRow = 100.

If you swap it for

EndRow = Range("a11").UsedRange.Rows.Count

would this make it more dynamic?

Regards
 
hi PaxtonRoadEnd

There are three examples on my site
Read the information

1) Loop through all the rows in the UsedRange (this is the first row with data till the last row with data on your sheet)
It can be slower if the column that you check doesn’t use so many rows or if your UsedRange is bigger then you data.
you can find more information on Debra Dalgleish's Web Site about this http://www.contextures.on.ca/xlfaqApp.html#Unused
2) You can fill in the StartRow and the EndRow yourself.
3) You can fill in the StartRow and the code will find the last row with data in the column that you want to check.
 

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