Represents the AutoFilter of a worksheet: the drop-down arrows in the header row of a range and the filters
set on its columns. Create it with
AddAutoFilter and get it with
AutoFilter.
A worksheet has at most one AutoFilter (the tables have their own). When a filter is set, the library hides
the rows of the range that do not meet the filters of all the columns, as Excel does; Excel keeps the filters
and lets the user change them. The first row of the range is the header row and is never hidden.
In the Excel 97-2003 format a column can be filtered by at most two values or two conditions. Formula cells are
compared by their calculated results (call
UpdateFormulaResult first for the formulas added in code).
Inheritance HierarchySystemObject
ExpertXls.ExcelLibExcelAutoFilter
Namespace: ExpertXls.ExcelLibAssembly: expertxls (in expertxls.dll) Version: 10.0.0
Syntaxpublic class ExcelAutoFilter
Public Class ExcelAutoFilter
The ExcelAutoFilter type exposes the following members.
Properties| | Name | Description |
|---|
 | ColumnsCount |
Gets the number of columns of the filtered range.
|
 | Range |
Gets the filtered range, including the header row.
|
 | Worksheet |
Gets the worksheet of this AutoFilter.
|
Top
Methods| | Name | Description |
|---|
 | ApplyFilters |
Applies the filters again after the cell values have changed: the rows of the range that meet the filters
of all the columns are shown and the other rows are hidden. The filter methods of this class apply the
filters automatically. Filters loaded from an existing workbook that the library cannot evaluate
(colors, icons, dates and top 10) leave the rows as they are, as Excel saved them.
|
 | ClearAllFilters |
Removes the filters of all the columns and shows all the rows of the range. The drop-down arrows remain;
call RemoveAutoFilter to remove the AutoFilter.
|
 | ClearFilter |
Removes the filter of the specified column and shows again the rows hidden only by it.
|
 | FilterByCondition |
Shows only the rows whose cell in the specified column meets a condition, for example greater than 100.
The filter replaces the previous filter of the column; the filters of the other columns are kept.
|
 | FilterByConditions |
Shows only the rows whose cell in the specified column meets two conditions joined by And or Or, for
example greater than or equal to 10 And less than 20. The filter replaces the previous filter of the
column; the filters of the other columns are kept.
|
 | FilterByValues |
Shows only the rows whose cell in the specified column displays one of the specified values, compared
without regard to case. A number or a date is compared by its displayed text, for example "1,250.00".
The filter replaces the previous filter of the column; the filters of the other columns are kept.
In the Excel 97-2003 format a column can be filtered by at most two values.
|
 | IsFiltered |
Gets a value indicating if the specified column has a filter.
|
Top
See Also