Deletes a query table

30/06/2015 § Leave a comment

Sub Clear_QueryTable()

Dim qt As QueryTable
For Each qt In ActiveSheet.QueryTables
If qt.Refreshing Then qt.CancelRefresh

End Sub



Deletes a query table. If the query table is refreshing asynchronously, Delete causes an error. Deleting a query table does not remove data from cells on a worksheet—it just removes the ability to refresh those cells from their data source.

The following code deletes all of the query tables on the active worksheet and clears their data:


Tagged: ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

What’s this?

You are currently reading Deletes a query table at RheXenoR.


%d bloggers like this: