I have a few sheets located at the end, which I don't want to include in my PDF print.
My code works but looks quite tough...
Sub DPPtoPDF()
Sheets("Readme").Visible = False
Sheets("Asbuilt Photos 1").Visible = False
Sheets("Asbuilt Photos 2").Visible = False
Sheets("Splicing Photos").Visible = False
Sheets("Sign Off Sheet").Visible = False
Sheets("OTDR TRACE-1").Visible = False
ThisWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ThisWorkbook.Path & "\" & ThisWorkbook.Name, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=True
Sheets("Readme").Visible = True
Sheets("Asbuilt Photos 1").Visible = True
Sheets("Asbuilt Photos 2").Visible = True
Sheets("Splicing Photos").Visible = True
Sheets("Sign Off Sheet").Visible = True
Sheets("OTDR TRACE-1").Visible = True
Sheets("Frontsheet").Select
End Sub
Basically I want to define some range of sheets, which I want to include in my PDF print.
Unfortunately, according to the thread below:
Specify an Excel range across sheets in VBA
it looks like I can set the range within one sheet only.
Other approaches:
vba print pdf files for specific list of sheets
don't work in my case
Is there any smarter option to select some range of sheets /or exclude some sheets/ for PDF printing?
PDF
. You have specified a list of worksheets not to include. Now do so with the worksheets and their associated ranges, or with one range address, , if it's always the same, and elaborate on the matters of headers, cell formatting, empty rows,... etc. – VBasic2008