tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,194
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi Everyone,
I have a macro that selects two sheets and creates a PDF, its exactly what I need except I need it to pick a selection of sheets to use from a list,
I have a sheet called "Control"
Range is T2:U20
In column T I have a list of sheet names, in column U I have a Yes or No,
I want each Sheet that has a yes next to it to be included in the PDF.
Heres the code I have,
Please help if you can
Thanks
Tony
I have a macro that selects two sheets and creates a PDF, its exactly what I need except I need it to pick a selection of sheets to use from a list,
I have a sheet called "Control"
Range is T2:U20
In column T I have a list of sheet names, in column U I have a Yes or No,
I want each Sheet that has a yes next to it to be included in the PDF.
Code:
Sub MultiPDF()
Sheets("Dashboard").Select
Sheets("Dashboard2").Select False 'select both sheets for PDF
Application.ScreenUpdating = False
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=ActiveWorkbook.Path & "\" & ActiveSheet.Range("AF5").Value & " " & Format(Now, "MM-DD-YYYY") & ".pdf", _
OpenAfterPublish:=True
Application.ScreenUpdating = True
End Sub
Please help if you can
Thanks
Tony