Have used activesheet.autofiltermode = false
and
dim Myworksheet as worksheet
Myworksheet.autofiltermode = false
Neither removed autofilter I've use Myworksheet.ShowAllData
beforehand as well.
Using Office 2013 Professional Plus
For a table you need different syntax:
activesheet.listobjects(1).Autofilter.showalldata
to clear the filter, or:
activesheet.listobjects(1).ShowAutoFilter = False
if you don't want the dropdowns visible at all.
This finally helped me figure out how to ensure that an Excel table's AutoFilter is on and showing all data. My final code is this:
If ActiveSheet.ListObjects(1).ShowAutoFilter Then
ActiveSheet.ListObjects(1).AutoFilter.ShowAllData
Else
ActiveSheet.ListObjects(1).ShowAutoFilter = True
End If
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