Saving to pdf

Coppa

New Member
Joined
Mar 17, 2011
Messages
13
Hi

I have a workbook with many sheets, and I would like to save some of them into a single pdf. The script I have below only saves the first sheet. Could somebody please help me out.

Thanks

Sub SavePDF()
Sheets(Array("Income Statement", "Membership List", "Expenses breakdown", "Budget")). _
Select
ActiveSheet.PrintOut Copies:=1, Collate:=True, ActivePrinter:="Adobe PDF"
End Sub
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Probably because you are using ActiveSheet, which is only 1 sheet. This works for me:
Code:
Sub Macro1()
    Sheets(Array("Sheet1", "Sheet3")).Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, ActivePrinter:="Adobe PDF"
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,814
Members
452,945
Latest member
Bib195

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
Back
Top