KlausW
Active Member
- Joined
- Sep 9, 2020
- Messages
- 396
- Office Version
- 2016
- Platform
- Windows
Hi, I use this VBA code to package multiple sheets into a PDF file. This works as it should. The challenge lies in the sheet Bilag, which is on several pages. With this VBA code, it only packes some of the sheet's Bilag pages. And not the whole sheets. Some who can help.
Any help would be appreciated.
Best regards Klaus W
Any help would be appreciated.
Best regards Klaus W
VBA Code:
Sub Rektangelafrundedehjørner5_Klik()
'Create and assign variables
Dim saveLocation As String
Dim sheetArray As Variant
saveLocation = Range("I3") & Sheets("Stamdata").Range("B1").Value & ".pdf"
sheetArray = Array("Rejsebeskrivelse", "Rapport", "Bilag")
'Select specific sheets from workbook, the save all as PDF
Sheets(sheetArray).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=saveLocation
Msgbox_BeforeRunning
End Sub