Excel.Filter class

Manages the filtering of a table's column.

[ API set: ExcelApi 1.2 ]

Extends
OfficeExtension.ClientObject

Properties

criteria

The currently applied filter on the given column. Read-only.

[ API set: ExcelApi 1.2 ]

Methods

apply(criteria)

Apply the given filter criteria on the given column.

[ API set: ExcelApi 1.2 ]

applyBottomItemsFilter(count)

Apply a "Bottom Item" filter to the column for the given number of elements.

[ API set: ExcelApi 1.2 ]

applyBottomPercentFilter(percent)

Apply a "Bottom Percent" filter to the column for the given percentage of elements.

[ API set: ExcelApi 1.2 ]

applyCellColorFilter(color)

Apply a "Cell Color" filter to the column for the given color.

[ API set: ExcelApi 1.2 ]

applyCustomFilter(criteria1, criteria2, oper)

Apply an "Icon" filter to the column for the given criteria strings.

[ API set: ExcelApi 1.2 ]

applyDynamicFilter(criteria)

Apply a "Dynamic" filter to the column.

[ API set: ExcelApi 1.2 ]

applyFontColorFilter(color)

Apply a "Font Color" filter to the column for the given color.

[ API set: ExcelApi 1.2 ]

applyIconFilter(icon)

Apply an "Icon" filter to the column for the given icon.

[ API set: ExcelApi 1.2 ]

applyTopItemsFilter(count)

Apply a "Top Item" filter to the column for the given number of elements.

[ API set: ExcelApi 1.2 ]

applyTopPercentFilter(percent)

Apply a "Top Percent" filter to the column for the given percentage of elements.

[ API set: ExcelApi 1.2 ]

applyValuesFilter(values)

Apply a "Values" filter to the column for the given values.

[ API set: ExcelApi 1.2 ]

clear()

Clear the filter on the given column.

[ API set: ExcelApi 1.2 ]

load(option)

Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties.

toJSON()

Property Details

criteria

The currently applied filter on the given column. Read-only.

[ API set: ExcelApi 1.2 ]

readonly criteria: Excel.FilterCriteria;
Property Value

Method Details

apply(criteria)

Apply the given filter criteria on the given column.

[ API set: ExcelApi 1.2 ]

apply(criteria: Excel.FilterCriteria): void;
Parameters
criteria
Excel.FilterCriteria

The criteria to apply.

Returns
void

applyBottomItemsFilter(count)

Apply a "Bottom Item" filter to the column for the given number of elements.

[ API set: ExcelApi 1.2 ]

applyBottomItemsFilter(count: number): void;
Parameters
count
number

The number of elements from the bottom to show.

Returns
void

applyBottomPercentFilter(percent)

Apply a "Bottom Percent" filter to the column for the given percentage of elements.

[ API set: ExcelApi 1.2 ]

applyBottomPercentFilter(percent: number): void;
Parameters
percent
number

The percentage of elements from the bottom to show.

Returns
void

applyCellColorFilter(color)

Apply a "Cell Color" filter to the column for the given color.

[ API set: ExcelApi 1.2 ]

applyCellColorFilter(color: string): void;
Parameters
color
string

The background color of the cells to show.

Returns
void

applyCustomFilter(criteria1, criteria2, oper)

Apply an "Icon" filter to the column for the given criteria strings.

[ API set: ExcelApi 1.2 ]

applyCustomFilter(criteria1: string, criteria2?: string, oper?: Excel.FilterOperator): void;
Parameters
criteria1
string

The first criteria string.

criteria2
string

Optional. The second criteria string.

oper
Excel.FilterOperator

Optional. The operator that describes how the two criteria are joined.

Returns
void

applyDynamicFilter(criteria)

Apply a "Dynamic" filter to the column.

[ API set: ExcelApi 1.2 ]

applyDynamicFilter(criteria: Excel.DynamicFilterCriteria): void;
Parameters
criteria
Excel.DynamicFilterCriteria

The dynamic criteria to apply.

Returns
void

applyFontColorFilter(color)

Apply a "Font Color" filter to the column for the given color.

[ API set: ExcelApi 1.2 ]

applyFontColorFilter(color: string): void;
Parameters
color
string

The font color of the cells to show.

Returns
void

applyIconFilter(icon)

Apply an "Icon" filter to the column for the given icon.

[ API set: ExcelApi 1.2 ]

applyIconFilter(icon: Excel.Icon): void;
Parameters
icon
Excel.Icon

The icons of the cells to show.

Returns
void

applyTopItemsFilter(count)

Apply a "Top Item" filter to the column for the given number of elements.

[ API set: ExcelApi 1.2 ]

applyTopItemsFilter(count: number): void;
Parameters
count
number

The number of elements from the top to show.

Returns
void

applyTopPercentFilter(percent)

Apply a "Top Percent" filter to the column for the given percentage of elements.

[ API set: ExcelApi 1.2 ]

applyTopPercentFilter(percent: number): void;
Parameters
percent
number

The percentage of elements from the top to show.

Returns
void

applyValuesFilter(values)

Apply a "Values" filter to the column for the given values.

[ API set: ExcelApi 1.2 ]

applyValuesFilter(values: Array<string | FilterDatetime>): void;
Parameters
values
Array<string | FilterDatetime>

The list of values to show. This must be an array of strings or an array of Excel.FilterDateTime objects.

Returns
void

clear()

Clear the filter on the given column.

[ API set: ExcelApi 1.2 ]

clear(): void;
Returns
void

load(option)

Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties.

load(option?: string | string[]): Excel.Filter;
Parameters
option
string | string[]

A comma-delimited string or an array of strings that specify the properties to load.

Returns
Remarks

In addition to this signature, this method has the following signatures:

load(option?: { select?: string; expand?: string; }): Excel.Filter - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load.

load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.Filter - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items.

toJSON()

toJSON(): Excel.Interfaces.FilterData;
Returns