工作表. 自动筛选属性 (Excel)Worksheet.AutoFilter property (Excel)

如果筛选功能为打开, 则返回**自动筛选** 对象。Returns an AutoFilter object if filtering is on. 此为只读属性。Read-only.

语法Syntax

表达式自动筛选expression.AutoFilter

_表达式_一个代表**工作表** 对象的变量。expression A variable that represents a Worksheet object.

备注Remarks

如果筛选已关闭,该属性返回 NothingThe property returns Nothing if filtering is off.

若要为工作表创建自动筛选对象, 必须手动或使用Range对象的**自动筛选** 方法对工作表上的区域启用自动筛选。To create an AutoFilter object for a worksheet, you must turn autofiltering on for a range on the worksheet either manually or by using the AutoFilter method of the Range object.

示例Example

下面的示例返回当前工作表的自动筛选。The following example returns AutoFilter for the current worksheet.

Dim Worksheet1 As Worksheet 
 
Dim returnValue As AutoFilter 
Set returnValue = Worksheet1.AutoFilter

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.