Monday, July 27, 2020

Excel To PDF with VBA

 

Sub ConvertExcelToPDF()
'Export Single Sheets
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="TrainingDeo",      OpenAfterPublish:=True

'Export Multiple Sheets
Sheets(Array("RemovingDuplicates", "HideUnhide", "ExportToPDF")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="TrainingDemo2", OpenAfterPublish:=True

Sheets("ExportToPDF").Select
Range("A1").Select
End Sub


Reference Code at YouTube

No comments:

Post a Comment

Your feedback is always appreciated. I will try to reply to your queries as soon as time allows.Please don't spam,spam comments will be deleted upon reviews.