Class Filters (Excel VBA)

A collection of Filter objects that represents all the filters in an autofiltered range. To use a Filters class variable it first needs to be instantiated, for example


Dim flts as Filters
Set flts = ActiveSheet.AutoFilter.Filters

For Each

Here is an example of processing the Filters items in a collection.


Dim flt As Filter
For Each flt In ActiveSheet.AutoFilter.Filters
	
Next flt

Count

Returns a Long value that represents the number of objects in the collection.


Dim lngCount As Long
lngCount = ActiveSheet.AutoFilter.Filters.Count

Item

Returns a single object from a collection.

Item (Index)

Index: The index number of the object.


Dim fltItem As Filter
Set fltItem = ActiveSheet.AutoFilter.Filters(Index:=1)