Excel VBA – Export Each Worksheet to a Separate PDF – Macro
If you need to Export Each sheet to an individual .pdf file this Macro will do it for you.
It will go through all the sheets in your Workbook and save each one to a separate PDF file using the worksheet name as file name.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
Sub ExportToPDFs() ' PDF Export Macro ' Change C:\Exports\ to your folder path where you need the diles saved ' Save Each Worksheet to a separate PDF file. Dim ws As Worksheet For Each ws In Worksheets ws.Select nm = ws.Name ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _ Filename:="C:\Exports\" & nm & ".pdf", _ Quality:=xlQualityStandard, IncludeDocProperties:=True, _ IgnorePrintAreas:=False, OpenAfterPublish:=False Next ws End Sub |
Posted by Excel Instructor:
http://www.houstoncomputerclasses.com/excel-classes/
