Save Each Worksheet as a Separate PDF in VBA
Hello friends!! We’ll be learning quick way to convert Excel sheets to PDF in VBA . These quick VBA tip will help you to save lot of time.
This VBA code will convert all the Excel sheets from the workbook to separate PDF files.
Use the following VBA code to convert to separate PDF
Sub SaveAsPDF()
Dim ws As Worksheet
For Each ws In Worksheets
ws.ExportAsFixedFormat xlTypePDF, "C:\Users\kedia niket\Documents\Case\" & ws.Name & ".pdf"
Next ws
End Sub
The code will read all the sheets available in the workbook and ExportAsFixedFormat xlTypePDF is command to export as Pdf and change the location where the output to be saved.
Keep visiting Analytics Tuts for more tutorials.
Thanks for reading! Comment your suggestions and queries