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??
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
17,019
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,016
Messages
5,834,956
Members
430,330
Latest member
drAli77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top