Delete hidden rows using VBA and an array?

LAAdams17

Board Regular
Joined
Oct 23, 2009
Messages
73
I have a spreadsheet with thousands of rows. I need to delete the rows that are filtered out. Each solution I've tried so far takes forever to get this done. I'm thinking there may be a much faster way to get this done using VBA and an array (read active worksheet into an array, delete the hidden rows and then write the array back out)? Can anyone help with this? Thank you in advance!
 
What did you do about removing the blank rows?

Also, does your data only exist in column A?
If not what happens if there are filters on columns other than column A? I'm asking because if there is a filter on a column other than column A then the results may not be correct,

.. and did you try (& time) the post # 9 code?
 
Last edited:
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
What did you do about removing the blank rows?

Also, does your data only exist in column A?
If not what happens if there are filters on columns other than column A? I'm asking because if there is a filter on a column other than column A then the results may not be correct,

.. and di you try (& time) the post # 9 code?
Since the rows are blank, for me it may not matter what column is filtered, but the first column in my dataset will always have info in it as it's the unique identifier. I did try the code from post #9, but found this other post much quicker.
 
Upvote 0
it may not matter what column is filtered
In fact it doesn't. My comment about possible incorrect results in relation to that were wrong.
Anyway, glad you have a good solution. (y)
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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