Hey all!
I've written a code to save a couple of selected pages as PDFs. My code works, saving it in the correct file path with the correct names and all. The problem is, the saved PDF has a third, blank page, when there should only be two. The selected ranges on both sheets go up to 46, and both are on one page, so I know it's not that.
Private Sub ConsentPDF_Click()
Dim Path As String
Dim FileName1 As String
Dim FileName2 As String
Dim FileName3 As String
Path = "O:\LAB\Label Tracking\Mailed Forms\"
FileName1 = "Use & Destruction Consent"
FileName2 = Sheets("Use Consent").Range("B2")
FileName3 = Sheets("Use Consent").Range("F2")
Sheets("Use Consent").Activate
ActiveSheet.UsedRange.Select
Sheets("Destruction Consent").Select
ActiveSheet.UsedRange.Select
ThisWorkbook.Sheets(Array("Use Consent", "Destruction Consent")).Select
Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Path & FileName1 & " - " & FileName2 & " - " & FileName3 _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
Thank you for any help!
Bookmarks