ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ODBC QueryTable Location (Cell address) (https://www.excelbanter.com/excel-programming/444153-odbc-querytable-location-cell-address.html)

hutteto[_2_]

ODBC QueryTable Location (Cell address)
 
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

ward376

ODBC QueryTable Location (Cell address)
 
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

hutteto

ODBC QueryTable Location (Cell address)
 
Thanks


All times are GMT +1. The time now is 04:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com