Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export a pivot table to excel

Status
Not open for further replies.

SkyHigh

Technical User
May 30, 2002
309
CA
Hi Folks
I have a pivot table form, I need some VBA routins to transfer pivot table on form to excel without actually opening this form i.e. from a command button on another form.

Your help is appreciated.
Brenda
 
Hi Brenda,

you can output any form with the following command:
Code:
DoCmd.OutputTo acOutputForm, "yourformname", _
acFormatXLS, "C:\ouputfile.xls", -1

The form does not have to be open for this to work.
If the outputfile does not look nice (some grey columns ...) you should consider tho output the datasource of the form i.s.o. the form itself.
Let me know, if you need more help.

Regards,
fly

Martin Serra Jr.
 
Hey Fly thanks, but what it does is to export all the data behind the pivot form instead of data in pivot format as it appears on the form.

Can you please help me further.

Thanks much !!!!
Brenda
 
Hi again Brenda,

I'm sorry but I don't know how to output the pivot view directly from Access to excel.
I'd suggest that you output the datasource of the form (table, query ...) and then create a pivot view from it in Excel again ...

Have you thought about a crosstab query instead of pivot view? I don't know what you are grouping ... summarizing ... with your pivot form, but perhaps you can also accomplish it with a crosstab query, that you can output to excel directly.

Sorry again that I don't have any better suggestions.

Regards,
fly

realworldname: Martin Serra Jr.
email: contact@mserrasystems.com
worldwideweb:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top