• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Export - New PPT File for Each Pivot Filter

MrsLisa

New Member
Hello. If any of you have a moment. I want to export a pivot table into a new powerpoint presentation for every color in the drop down filter (cell c4). If possible, I also want to name each new powerpoint the title located in cell A1 + filter color "c4". Also, if the chart is over 30 rows, I would like the chart to insert a page break and continue on a second slide (my example will not be that long, but my original excel pivot table may have many rows and will take 2 powerpoint slides. I appreciate any help you can provide. Thank you very much
 

Attachments

  • Colors example.xlsx
    91.8 KB · Views: 1
So, your table is based on OLAP. This makes looping through Filter extremely difficult and cumbersome.

You should utilize PivotSlicerCache, or some other method to filter and loop PivotItems within the field.

As, well. There is no direct way to export Excel range as PPT file as far as I know. You will need to open PowerPoint and paste in the data or import range/data.

See if link below helps you.
https://www.thespreadsheetguru.com/blog/2014/3/17/copy-paste-an-excel-range-into-powerpoint-with-vba
 
Thank you Chihiro. You are always so helpful. I was think see my example below in making a separate list called "colors" instead of sending to printer, export to powerpoint. Sorry if this sound ridiculous, but if it loops to the printer can't it loop to an export?

______My Attempt at a bad example_______
Public Sub PrintSheets()

Dim rng As Range
Dim c As Range
Set rng = Range("Colors")
For Each c In rng
Range("A6").Value = c.Value
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
'ActiveWindow.SelectedSheets.PrintPreview
Next c

End Sub
 
Unfortunately no. Since, there is no option to export as PPT file as far as I know.

Best bet is to follow steps in link and test. I don't have PPT installed on my machine, so can't test on my end.
 
Back
Top