SQL SELECT to create a table from another table within Excel workbook

kwagner1

Active Member
Joined
Jun 10, 2003
Messages
445
Greetings,

i am using external connection to select a recordset into my Excel workbook (call it Table01). That is working fine.
My question is: from the original table that i created (Table01) i want to then execute another sql "select" statement from within Excel to query the first worksheet and create a new table (Table02). The new table is a smaller subset of the first one.

is this possible??
 

Some videos you may like

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,393
Hi,

I think its possible.

Try this

1. name the source range (say MyRange)
2. save and close the file
3. open a new and empty file
4. Data>From other sources>Microsoft Query
5. choose Excel files OK
6. locate the file that contains the data, select it, OK
7. Use the arrow to transfer the named range (MyRange) to the right-panel Next
8. in the next window you can filter data or go ahead, Next, Next and pick the second option "View data or edit query in Microsoft Query"
9. Finish opens the Microsoft Query window where you can use SQL
10. After you have used Select...you can click in the icon with an open-door + an arrow to the left to transfer the selected data to Excel.

Good luck!

M.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,986
Messages
5,526,065
Members
409,685
Latest member
Davetom

This Week's Hot Topics

Top