I would like to use cell values on Sheet 4 to select and export Sheet 1, Sheet 2, and Sheet 3 as one PDF file.
For example, if Sheet 4's A1=1, A2=1, and A3=0, then it would print Sheet 1 and Sheet 2, but not Sheet 3.
I tried to use the IF function to create an array of sheets, but I have not been successful.
Any help would be appreciated.
Sheets As PDF
Links
Export multiple sheets to PDF simultaneously without using ActiveSheet or Select (SO)
Workbook.ExportAsFixedFormat method (Excel) (Microsoft)
VBA - Add sheets to variable and move to new workbook (SO)
Short Description (not 100% precise)
The Improved Fast Array Version copies the Source Range into the Range Array. By looping through the elements of the Range Array, it checks for the Criteria and if found, writes the appropriate Sheet name to the Sheet Array. When done, it 'adjusts' the Sheet Array and copies the sheets (in one go) to a new workbook, which is then exported as PDF, before it is closed.
Improved Fast Array Version
First Slow Range/Worksheet Version