跳到主要内容

SetAutoFilter

Adds an AutoFilter to the current range.

Syntax

expression.SetAutoFilter(Field, Criteria1, Operator, Criteria2, VisibleDropDown);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
FieldRequirednumberThe integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field one).
Criteria1Requiredstringstring[]ApiColor
OperatorRequiredXlAutoFilterOperatorAn XlAutoFilterOperator constant specifying the type of filter.
Criteria2RequiredstringThe second criteria (a string). Used with Criteria1 and Operator to construct compound criteria.
VisibleDropDownRequiredbooleanTrue to display the AutoFilter drop-down arrow for the filtered field. False to hide the AutoFilter drop-down arrow for the filtered field. True by default.

Returns

This method doesn't return any data.