Open Access query in Excel with 'save formatted'

I

IrishRed

I have a query in access which is doing a group by on one field and a sum on
another field. The query runs fine and I get one ID (group by) and a total
(sum).
I have a macro which will open the result of this query in Excel. When this
runs all of the data (no group by or sum) is being sent to Excel. If I were
to do a file export on the query and click on 'save formatted' then I get
exactly what I want but using the macro to do the export is not allowing me
to 'save formatted' so I am ending up with all of the data in my Excel
spreadsheet. I am wondering if there is a way to export the query results
only to Excel.
Any help you can give would be appreciated. Thanks for your time.
 
J

Jeanette Cunningham

IrishRed,
here is an idea - I don't know if it will suit your situation.
You can import a query from Access into Excel by starting in Excel.
Open a new worksheet, on the Menu click Data >> Import External DataNavigate to the saved query in your access database and follow the prompts
as excel guides you through the process.
If this suits your situation, it is an easy solution without any coding
involved.

Jeanette Cunningham
 
I

IrishRed

Thank you Jeanette. That was very helpful. I am getting back into Access and
Excel after years of doing other projects that have taken me away from it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top