export a query using macro

luvbite38

Active Member
Joined
Jun 25, 2008
Messages
368
Hi,

Thanks in advance for any help

is there a way to automatically run and export the query into a specific sheet of a Excel workbook ?

Please help
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Yes, you can either use the MSQuery engine and drop it on a worksheet, then record a macro to refresh the query, or if you need something more advanced you can use ADO.
 
Upvote 0
data ribbon->From other sources -> microsoft query.

Or you might want to use the data connection wizard. Either way, you will end up in MSQuery engine which is a graphical query builder the same as in Access.

Once you have connected to the data source, you can select the tables / columns you want, test the query a bit, etc, then return the results to Excel by clicking on the little door icon (just to the right of the old school save disk icon).
 
Upvote 0

Forum statistics

Threads
1,216,118
Messages
6,128,939
Members
449,480
Latest member
yesitisasport

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
Back
Top