KlausW
Active Member
- Joined
- Sep 9, 2020
- Messages
- 378
- Office Version
- 2016
- Platform
- Windows
Hi, I'm using this VBA code to save the sheets, this works really well.
Now I would like Excel to save the same sheets, but some sheets may well be on 2 or more pages it appears in F1. Is it possible to save exactly the number of pages.
All help will be appreciated.
Best Regards Klaus W
VBA Code:
'Create and assign variables
Dim saveLocation As String
Dim sheetArray As Variant
saveLocation = "C:\Users\k-wit\Documents\Bestilling af proviant\" & Sheets("Indkøbsrekvisition").Range("m1").Value & ".pdf"
sheetArray = Array("Bestilling", "Indkøbsrekvisition")
'Select specific sheets from workbook, the save all as PDF
Sheets(sheetArray).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=saveLocation
All help will be appreciated.
Best Regards Klaus W
Last edited by a moderator: