+ Reply to Thread
Results 1 to 13 of 13

Remove hundreds of empty rows

  1. #1
    drews
    Guest

    Post Remove hundreds of empty rows

    I am working in a workbook with a couple thousand rows and there are several hundred rows that are entirely blank/empty..

    How can I select only those rows which are entirely empty and delete them?

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Remove hundreds of empty rows

    Like this?
    Attached Files Attached Files
    Last edited by JieJenn; 11-22-2011 at 03:38 PM.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Remove hundreds of empty rows

    JieJenn please add Code Tags properly then explain how that will remove empty Rows
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Remove hundreds of empty rows

    Sorry, I was in editing screen.

  5. #5
    drews
    Guest

    Re: Remove hundreds of empty rows

    Thanks for the response JieJenn, however the way that your macro functions is that if only 1 cell is blank but others contain data, that row is still deleted.

    I need to be able to only delete the rows that literally have nothing in them.

    So for example, I may have a row where columns A, B and C are empty, but D contains needed data; in this case I would not want to delete that row. Does that make sense?

  6. #6
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Remove hundreds of empty rows

    I use something like this
    Please Login or Register  to view this content.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  7. #7
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Remove hundreds of empty rows

    Oh gotcha. In that case I would probably add Counta() like the code Tom provided.

  8. #8
    drews
    Guest

    Re: Remove hundreds of empty rows

    Perfect tom! Thank you!

  9. #9
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Remove hundreds of empty rows

    Not all forums are the same - seek and you shall find

  10. #10
    drews
    Guest

    Re: Remove hundreds of empty rows

    Quick follow up! I am able to run this script just fine when testing it with 30+ rows... however when I executed it in the workbook I am working on... it ran for awhile (obvious as there are over 2000 rows).. I gave me an error "('1004') Delete method of Range class failed".

    Any ideas?

  11. #11
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Remove hundreds of empty rows

    drews,
    the code works fain, I deleted rows from 349 to 2464, or from 2465 to 65001 (it takes some time but it works)
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  12. #12
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Remove hundreds of empty rows

    This is the one I used and it works fine for me.

    Please Login or Register  to view this content.

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Remove hundreds of empty rows

    drews,

    I'm afraid your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1