QueryTable 对象 (Excel)QueryTable object (Excel)

表示从外部数据源 (如 SQL server 或 Microsoft Access 数据库) 返回的数据生成的工作表表。Represents a worksheet table built from data returned from an external data source, such as a SQL server or a Microsoft Access database.


QueryTable 对象是 QueryTables 集合的成员。The QueryTable object is a member of the QueryTables collection.


使用**QueryTables** (索引), 其中_索引_是查询表的索引号, 返回单个的查询表对象**** 。Use QueryTables (index), where index is the index number of the query table, to return a single QueryTable object.

以下示例对查询表一进行设置,每当查询表刷新时就自动更新右侧的公式。The following example sets query table one so that formulas to the right of it are automatically updated whenever it's refreshed.

Sheets("sheet1").QueryTables(1).FillAdjacentFormulas = True




另请参阅See also

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