Convert Multiple Sheets To Multiple PDF Files

How to concert multiple worksheets in an Excel workbook to multiple PDF files using VBA.

Convert Multiple Sheets To Multiple PDF Files

Here’s the complete VBA code to export each worksheet in an Excel workbook into individual PDF files:

Option Explicit

Sub ExportSheetsToPDFs()
Dim ws As Worksheet
Dim mywsname As String

For Each ws In Worksheets
mywsname = ws.Name
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=”C:\Users\takyar\Desktop\” & mywsname & “.pdf”, _

Next ws
End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.