Worksheet.AutoFilterMode Property

 

Gets or sets a value that indicates whether filtering is currently enabled on the worksheet (that is, whether the filter drop-down arrows are currently displayed).

Namespace:   Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

bool AutoFilterMode { get; set; }

Property Value

Type: System.Boolean

true if filtering is currently enabled on the worksheet; otherwise, false.

Exception Condition
COMException

This property is set to true.

You can set this property to false to disable filtering (that is, to remove the filter drop-down arrows), but you cannot set it to true. To enable filtering and create a filtered list, use the AutoFilter method of a Range object, or use the AutoFilter method of a NamedRange object.

This property indicates only whether filtering is enabled; it does not indicate whether any data is being filtered. To determine whether the worksheet is actively filtering data, use the FilterMode property.

Return to top
Show: