查询表排序属性 (Excel)QueryTable.Sort property (Excel)

返回查询表范围的排序条件。Returns the sort criteria for the query table range. 此为只读属性。Read-only.

语法Syntax

表达式排序expression.Sort

_表达式_一个代表查询表对象**** 的变量。expression A variable that represents a QueryTable object.

注解Remarks

如果使用用户界面导入数据, 来自 web 查询或文本查询的数据将作为一个查询表**** 对象导入, 而所有其他外部数据将作为**ListObject** 对象导入。If you import data by using the user interface, data from web queries or text queries is imported as a QueryTable object, while all other external data is imported as a ListObject object.

如果使用对象模型导入数据, 则必须将来自 web 查询或文本查询的数据作为查询表**** 导入, 而所有其他外部数据均可作为ListObject或查询表导**** 入。If you import data by using the object model, data from web queries or text queries must be imported as a QueryTable, while all other external data can be imported as either a ListObject or a QueryTable.

您可以使用ListObject的查询表属性来访问Sort属性。 You can use the QueryTable property of the ListObject to access the Sort property.

示例Example

本示例刷新查询表并获取排序条件。This example refreshes the query table and gets the sort criteria.

QueryTable.Refresh 
 
Dim var As Sort 
Set var = QueryTable.Sort

支持和反馈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.