[xpost][/xpost]
https://www.mrexcel.com/board/…files-vba-coding.1195462/
Hi all,
I am a bit new to VBA coding but have managed to create a macro that lets me save multiple worksheets to separate pdf's.
But, I don't want to include two specific sheets, for ex, sheet TEMPLATE and SOURCE DATA how can I exclude these two and print the rest?
This is my code:
Code
Sub LoopSheetsSaveAsPDF()
'Create variables
Dim ws As Worksheet
'Loop through all worksheets and save as individual PDF in same folder
'as the Excel file
For Each ws In ActiveWorkbook.Worksheets
ws.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=ThisWorkbook.Path & "/" & ws.Name & ".pdf"
Next
End Sub
Display More
I would be very grateful for any assistance
My best regards from a cold Sweden,
Fredrik