PDA

View Full Version : [SOLVED] VBA: Export Certain sheets of a workbook as PDFs



josephir
07-28-2014, 06:51 AM
I want to export the second, third, and sixth worksheets of a workbook of mine as PDFs. I can't figure out how to do it for these specific sheets without distorting the PDF.

patel
07-28-2014, 07:21 AM
Sub exportToPdfsomeSheetsTo1pdf() ' tutti i fogli in un unico documento
Sheets(Array("name1", "name2","name3")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
"C:\Users\user\Desktop\NewBook.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
Sheets(1).Select
End Sub

josephir
07-28-2014, 10:28 AM
That works to perfection, thanks a ton!