walters303
New Member
- Joined
- Jan 28, 2015
- Messages
- 2
Using Excel 2013. I have several different worksheets with varying number of pages. I'm looking to put a macro button on the different pages that I want to print-to-pdf so that all i need to do is click the button and THAT particular page prints.
When it prints-to-pdf I want the pdf page to automatically go to my desktop with the worksheet name and nothing else. The vba code that allows me to do this with in a completely different situation is below. Note: I dont want the date to be part of the filename. Thanks for the help!
Sub Save_ActSht_as_Pdf()
' Saves active sheet as PDF file.
Dim Name As String
Name = ThisWorkbook.Path & "\" & ActiveSheet.Name & " " & _
Format(Now(), "mm.dd.yy") & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Name, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
When it prints-to-pdf I want the pdf page to automatically go to my desktop with the worksheet name and nothing else. The vba code that allows me to do this with in a completely different situation is below. Note: I dont want the date to be part of the filename. Thanks for the help!
Sub Save_ActSht_as_Pdf()
' Saves active sheet as PDF file.
Dim Name As String
Name = ThisWorkbook.Path & "\" & ActiveSheet.Name & " " & _
Format(Now(), "mm.dd.yy") & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Name, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub