Printing a pivot table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to be able to print a pivot table, but I need the selection that it prints to update depending on the size of the pivot table. Creating a macro that selects the pivot table first then prints it, prints it out as two pages, one for the pages, the second for the data

Any help

Thanks
Grant.
 
If you set the worksheet to print to one page (File>Page Setup, Page
tab), it should automatically adjust to fit the entire pivot table, no
matter how it's arranged.
 
The only problem is I am trying to setup the printing from a macro. I have two pivot tables on the one sheet, and I want to be able to choose which one I print

----- Debra Dalgleish wrote: ----

If you set the worksheet to print to one page (File>Page Setup, Page
tab), it should automatically adjust to fit the entire pivot table, no
matter how it's arranged

Grant wrote
 
The following code will print the first of the pivot tables:

Sub PrintPivotTable()
Dim ws As Worksheet
Set ws = Worksheets("Pivot")
'Note: TableRange1 doesn't include page fields
ws.PivotTables(1).TableRange2.Select
ws.PageSetup.PrintArea = Selection.Address
ws.PrintPreview

End Sub
 

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

Back
Top