Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I know how to get the results for a SQL query into a sheet like this: ActiveSheet.QueryTables.Add(Connection:=connstring , Destination:=Range("A1"), Sql:=sqlstring).Refresh I need my code for the SQL query to put the results into an array varable (or something like that) that I can refrence. My goal in all of this is to run a second query and loop through each instance of the 1st query without having to put the 1st query results on a sheet and then iterating through it. The best way to describe what I'm doing is I want to 1st query the list of sales people in a table and then run a 2nd query that will give me the sales data for each of the sales people and put that info into the workbook. If I can get this to work, we can add sales people to the database and I won't have to revist my code. If my approach is wrong please help me. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to create a lookup table with an added varable? | Excel Worksheet Functions | |||
Error: Number of query values and destination fields are not the s | Excel Worksheet Functions | |||
How can I assign a varable to equal an array? (it allready has a name) | Excel Programming | |||
Query for data in an array | Excel Programming | |||
Range as varable | Excel Programming |