Skip to main content

Worksheet.QueryTables property

Table of contents
  1. Syntax
  2. Example

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

Syntax

expression.QueryTables

expression A variable that represents a Worksheet object.

Example

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

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>