Hi,
I have a little script which prints out a selection of pages from a workbook to my default printer.
Different pages will print depending on the parameters of the job, so I have formulas in cell A1 of each sheet to show whether that page is to be printed or not. This all works fine.
I now want to extend the functionality so that at the same time I can create and save a single PDF file containing all of the pages with "Print" in cell A1 in order. Ideally the name of this pdf will also be set to 'Inputs!B3&"_mfg_dwg_pk" - our job no. is located on the 'Inputs' tab in cell B3, so a typical name may be 40850_mfg_dwg_pk. If this is not easily done then we can of course name the PDF when prompted by the PDF software.
Any assistance will, as always, be appreciated. Thanks in advance
I have a little script which prints out a selection of pages from a workbook to my default printer.
Code:
Private Sub CommandButton1_Click()
Dim WS As Worksheet
For Each WS In ActiveWorkbook.Worksheets
If WS.Range("$A$1") = "Print" Then WS.PrintOut
Next WS
End Sub
Different pages will print depending on the parameters of the job, so I have formulas in cell A1 of each sheet to show whether that page is to be printed or not. This all works fine.
I now want to extend the functionality so that at the same time I can create and save a single PDF file containing all of the pages with "Print" in cell A1 in order. Ideally the name of this pdf will also be set to 'Inputs!B3&"_mfg_dwg_pk" - our job no. is located on the 'Inputs' tab in cell B3, so a typical name may be 40850_mfg_dwg_pk. If this is not easily done then we can of course name the PDF when prompted by the PDF software.
Any assistance will, as always, be appreciated. Thanks in advance