Compartilhar via


Worksheet.AutoFilter Property

Excel Developer Reference

Returns an AutoFilter object if filtering is on. Read-only.

Syntax

expression.AutoFilter

expression   A variable that represents a Worksheet object.

Remarks

The property returns Nothing if filtering is off.

To create an AutoFilter object for a worksheet, you must turn autofiltering on for a range on the worksheet either manually or using the AutoFilter method of the Range object.

Example
The following example returns autofilter for the current worksheet.

Visual Basic for Applications
  Dim Worksheet1 As Worksheet

Dim returnValue As AutoFilter returnValue = Worksheet1.AutoFilter

See Also