Save Multiple Sheets as Single PDF

Sargad_Strut

New Member
Joined
Mar 28, 2014
Messages
44
Hi guys,

Yes, I know this question have been posted before, but I couldn't make use of the suggestions I found.
This is my current code:

Sub SaveAllAsPDF()
Dim wsh As Worksheet, vWshs, vWshName
RptDatum = Range("C10")
vWshs = Array("SheetX", "SheetY", "SheetZ")
With ActiveWorkbook
For Each vWshName In vWshs
.Worksheets(vWshName).<wbr>ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="G:\MyFolder\" & RptDatum & vWshName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
Next vWshName
End With
End Sub

It's working just fine, but I'd like to merge the sheets into a single PDF.

Any help would be much appreciated!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi Trevor, thanks for your reply!

I actually came across that site when I tried to figure this out myself. However, I don't want to save all the sheets (about 40 in total), just eleven specific (monthly reports).
And yes, all the page setups are the same.

If possible I'd like to expand/edit the code above to "merge" this 11 sheets into a PDF somehow, so that I can still have a button attached to it for coworkers to use.
Thanks
 
Upvote 0
I have just recorded a macro to group three sheets then save as PDF, they go into 1 PDF document, here is the recorded code.

Sub Macro4()
'
' Macro4 Macro
'
'
Sheets(Array("All Data 1", "Sheet2", "Sheet3")).Select
Sheets("All Data 1").Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\Trevor Glover\Documents\Book1.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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