Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Query database results in a named range

Good day.

Worksheet "A" has a working VLOOKUP to a named range in worksheet "B".
However, after adding a query of an MS SQL database to retrieve fresh data,
that VLOOKUP returns "#N/A".

I have placed the query results in another range on worksheet "B" and jumped
through all sorts of hoops to "place" that data in the previosuly named
range, but cannot get past the "#N/A".

Any suggestions are greatly appreciated. Thank you.
--
Chuck Buchanan
Special Projects Coordinator
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Query database results in a named range

Chuck:

Assume you have a named range called "ImporData" and a querytables item 1
(default item number). This will set the named range to the range address of
the querry reslults.

ActiveWorkbook.Names("ImportedData").RefersTo =
ActiveSheet.QueryTables(1).resultrange.name

Good Luck

--
Stewart Rogers
DataSort Software, L.C.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel query and link named range Jessica Links and Linking in Excel 0 July 6th 09 09:10 PM
How Do I Query a Named Range JeffP-> Excel Worksheet Functions 2 February 3rd 09 11:11 PM
sum of a named range with values based on vlookup results Solutions Manager Excel Worksheet Functions 20 January 31st 09 03:01 AM
prevent duplicate results (database query) Dan Wasser[_2_] Excel Programming 2 September 28th 04 09:22 PM
help in showing results of database query andy[_6_] Excel Programming 1 August 27th 04 08:47 AM


All times are GMT +1. The time now is 10:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"