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?
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?
Like this?
Last edited by JieJenn; 11-22-2011 at 03:38 PM.
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
Sorry, I was in editing screen.
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?
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.
Oh gotcha. In that case I would probably add Counta() like the code Tom provided.
Perfect tom! Thank you!
Also posted here http://www.vbaexpress.com/forum/show...69&postcount=1
Not all forums are the same - seek and you shall find
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?
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-
This is the one I used and it works fine for me.
![]()
Please Login or Register to view this content.
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks