Print Multiple Charts to a single PDF, but not all Charts

jl2509

Board Regular
Joined
Oct 30, 2015
Messages
145
Hi All,

Can anyone help with my issue below please

I have multiple charts on a worksheet (Dashboard) and have several command buttons which will print selected Charts.

I can print individual Charts to PDf, Print Multiple Charts to Individual PDFs but cannot fathom how to print multiple Charts to a Single PDF!

I have started using the "rough" code below, which prints all my selected charts to individual PDFs with individual names, but I want to have a single PDF which will save the filename as a cell reference (i.e A1="Future predictions 2018") but give the option to change the save as location.

Once I have this, I can then try to elaborate the code to include, page setup options such as "Landscape, Margins etc"

Thank you

Code:
Sub PrintChartArray()

ActiveSheet.Shapes.Range(Array("Chart 8", "Chart 9", "Chart 10", "Chart 24", "Chart 25", "Chart 29")).Select
Dim saveLocation As String
Dim x As Integer
ChartList = ActiveSheet.ChartObjects.Count
For x = 1 To 6
ActiveSheet.ChartObjects(x).Select
ActiveSheet.ChartObjects(x).Activate
saveLocation = Application.GetSaveAsFilename(fileFilter:="PDF Files (*.pdf), *.pdf")
If saveLocation <> "False" Then
ActiveSheet.ExportAsFixedFormat xlTypePDF, saveLocation, xlQualityStandard
End If
Next
 
End Sub
 

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Watch MrExcel Video

Forum statistics

Threads
1,122,518
Messages
5,596,621
Members
414,082
Latest member
sasmita

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
Top