QueryTables Property
TOC
Collapse the table of content
Expand the table of content

Worksheet.QueryTables Property (Excel)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns the QueryTables collection that represents all the query tables on the specified worksheet. Read-only.

expression .QueryTables

expression A variable that represents a Worksheet object.

This example refreshes all query tables on worksheet one.

For Each qt in Worksheets(1).QueryTables 
 qt.Refresh 
Next

This 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
Show:
© 2016 Microsoft