VBA To Delete Hidden Rows for a large set of data

pliskers

Active Member
Joined
Sep 26, 2002
Messages
462
Office Version
  1. 2016
Platform
  1. Windows
I've found several versions of code to delete all hidden rows within a worksheet, but each of them is a loop that evaluates each row one by one. With a worksheet such as the one I'm working with, with tens of thousands of records, this is not a usable solution due to the amount of time it takes to cycle through the entire data set.

Is there another way to do that that would capture and delete the hidden rows in more of a single step approach? Conversely, would something work faster if I hid only the records I want to keep and have the code delete all visible rows?

I'm stumped! Thanks for any help,
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Is there any condition which has to be met before you hide rows?
 
Upvote 0
Is there any condition which has to be met before you hide rows?
I should have clarified. By "hidden", I'm referring to rows that are filtered via a slicer and therefore not visible. They are not literally hidden.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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