Extract MS Query Cell Address

  • Thread starter Thread starter ExcelMonkey
  • Start date Start date
E

ExcelMonkey

When I Import Data (MS Query) into my spreadsheet is asks for destination
cell. Is it possible to extract this cell address from the MS Query object
after-the-fact?

Thanks
EM
 
The querry Name and Range becomes a defined Name on the worksheet. You can
view the range on the worksheet by going to menu and doing the following

File - Properties - Contents


Use this VBA code to see all names including querry name

For Each myname In ThisWorkbook.Names
MsgBox (myname.Name & " Range is : " & myname)
Next myname:
 
This almost gets me there but I will need a way to differentiate between the
named cells. Don't think there is a way to do that.

EM
 
Dim rng as range
set rng = ActiveSheet.QueryTables(1).ResultRange
msgbox rng.Cells(1, 1).Address
 

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

Back
Top