<< Click to Display Table of Contents >> Filters (collection) |
Access paths:
▪Application à Workbooks à Item à Sheets à Item à AutoFilter à Filters
▪Application à Workbooks à ActiveSheet à AutoFilter à Filters
▪Application à ActiveWorkbook à ActiveSheet à AutoFilter à Filters
▪Application à ActiveSheet à AutoFilter à Filters
1 Description
The Filters collection contains all columns of the currently active AutoFilter.
The individual elements of this collection are of the type Filter. You can use the individual Filter objectsto query the selection criteria and operators of individual columns of the AutoFilter.
2 Access to the collection
Each AutoFilter has exactly one Filters collection. It is accessed through AutoFilter.Filters:
' Display the number of columns in the AutoFilter
MsgBox pm.ActiveSheet.AutoFilter.Filters.Count
3 Properties, objects, collections and methods
Properties:
▪Count R/O
Objects:
▪Item → Filter (default object)
▪Application → Application
▪Parent → AutoFilter
Count (property, R/O)
Data type: Long
Returns the number of Filter objects in the collection, i.e. the number of columns contained in the active AutoFilter.
Item (pointer to object)
Data type: Object
Returns an individual Filter object, i.e. one individual column in the AutoFilter.
Which column you get depends on the numeric value that you pass to Item: 1 for the first column, 2 for the second, etc.
Application (pointer to object)
Data type: Object
Returns the Application object.
Parent (pointer to object)
Data type: Object
Returns the parent object, i.e. an object of the type AutoFilter.