Deleting multiple listrows

storm8

Active Member
Joined
Apr 7, 2010
Messages
327
Hello,
is it possible to delete at once more than 1 row with listobject?
method listobjects(x).listrows(y).delete is for some reason incredibly slow to have it in loop and because of other tables on worksheet I cannot delete entire sheet row by entirerow.delete

generally, is it possible to work with multiple listrows in listobject?

any suggestions please? Thanks alot
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
A few months ago I was trying to help someone remove 2500 or so rows meeting a criteria that were scattered through a large data set.

It was taking a few seconds on my test data mockup but 30 minutes or more for the other person. :eeek:

It took 10 posts or so to figure out that their data was in a listobject (Table),
and as you are finding, it can be painfully slow to delete each row.

We compared several different approaches and found the fastest result from:
1. Adding a column with the header "Delete" and the row number in each cell.
2. For each row to be deleted, replace the row number in the added column with the word "Delete"
3. Applying RemoveDuplicates using the added Column as the criteria
4. Clean up by deleting the added Column and Blank rows that will now be a continguous range
at the bottom of the table. You can delete those rows in one step manually or with your macro.
 
Upvote 0
This seems as brilliant idea, thank you!
I also figured that since I usually want to delete end of table (eg last x rows) I might also clear contents from them and resize the table to match actual last row.
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,881
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top