I have a report, that is made up of multiple worksheets, I am trying to create a printed report of specific worksheets that print as an individual PDF
the following code does this
Each worksheet is identical, and what I want to achieve is to only print/PDF the worksheets that contain an entry in a specific cell.
So e.g. if worksheet1 cell A3 contains an entry, worksheet 2 Cell A3 is blank, and worksheet3 cell A3 has an entry, only workshet 1 and 3 will be added to the printout/PDF
How would I achieve this?
the following code does this
VBA Code:
Sub PrintAllSheetToPdf()
For Each iSheet In ActiveWorkbook.Worksheets
Sheets(Array("Sheet 1", "Sheet 2", "Sheet 3")).Select
Next iSheet
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
iFolder = .SelectedItems(1) & "\"
End With
iFile = InputBox("Enter New File Name", "PDF File Name")
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=iFolder & iFile, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub
Each worksheet is identical, and what I want to achieve is to only print/PDF the worksheets that contain an entry in a specific cell.
So e.g. if worksheet1 cell A3 contains an entry, worksheet 2 Cell A3 is blank, and worksheet3 cell A3 has an entry, only workshet 1 and 3 will be added to the printout/PDF
How would I achieve this?