ODBC QueryTable Location (Cell address)

H

hutteto

I'm using the following query to loop through each embedded ODBC query
in each worksheet in the workbook.

Dim TargetFile As Workbook
Dim ws As Worksheet
For Each ws In TargetFile.Worksheets
For Each qt In ws.QueryTables
qt.Connection.name
Next qt
Next ws

I'd like to know where the query is embedded (cell address location of
the query).
How do I do this?

Thanks
 
W

ward376

Dim ws As Worksheet
Dim qt As QueryTable

Sub qtAddy()
For Each ws In ThisWorkbook.Worksheets
For Each qt In ws.QueryTables
MsgBox qt.Destination.Address
Next qt
Next ws
End Sub

Thanks!
Cliff Edwards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top