ODBC QueryTable Location (Cell address)

  • Thread starter Thread starter hutteto
  • Start date Start date
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
 
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
 
Back
Top