Remarks

The Filter object is a member of the collection. The Filters collection contains all the filters in an autofiltered range.

Example

Use (), where is the filter title or index number, to return a single Filterobject. The following example sets a variable to the value of the property of the filter for the first column in the filtered range on the Crew worksheet.

Visual Basic for Applications
Set w = Worksheets("Crew") If w.AutoFilterMode Then filterIsOn = w.AutoFilter.Filters(1).On End If

Note that all the properties of the Filter object are read-only. To set these properties, apply autofiltering manually or using the method of the object, as shown in the following example.

Visual Basic for Applications
Set w = Worksheets("Crew") w.Cells.AutoFilter field:=2, Criteria1:="Crucial", _ Operator:=xlOr, Criteria2:="Important"
filter object

See also:

index index