I'm trying to run a macro that replaces data in a table in Excel, when the data might initially be filtered.
The code should remove the filter first, then run the rest of the code.
I tried the "Autofilter" command, but then the normal filter option on the table's range weren't visible, and I had to manually create the filter option again (not a big deal to me, but other people use this file).
Is there a way to clear the filter WITHOUT removing filters from the table?
For a Table, you can simply use the ShowAllData
method of its Autofilter
object:
activesheet.listobjects(1).autofilter.showalldata
Note this won't error even if there is no filter currently applied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With