To save the currently active sheet as a PDF you could use something like the following in code. Hopefully it is obvious that you can modify the constants at the top to suit your filepath and filename;
Sub SaveAsPDF()
Const FILEPATH As String = "C:\Users\MaryRen\Desktop\Test\"
Const DOCNAME As String = "mypdf.pdf"
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
FILENAME:=FILEPATH & DOCNAME, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End Sub
Bookmarks