In this tutorial you will learn how to save entire Workbook as a PDF file using VBA macro programming in Microsoft Excel
VBA Code:
'This code will save the entire workbook as PDF
Sub SaveWorkshetAsPDF()
Dim CurrentFile As String
CurrentFile = Replace(ThisWorkbook.Name, ".xlsm", ".pdf")
ThisWorkbook.ExportAsFixedFormat xlTypePDF, "D:\demo\" & CurrentFile
MsgBox ("Workbook saved successfully")
End Sub
How to each worksheet as a separate PDF: • How to save each worksheet as a separ...