KlausW
Active Member
- Joined
- Sep 9, 2020
- Messages
- 386
- Office Version
- 2016
- Platform
- Windows
Hi I have a little challenge. I use this VBA code to store a number of sheets in PDF, and it will be counted how many sheets are to be saved by sheet Bestilling cell F1. And it works really well.
Now I really want it to be counted together how many sheets are to be saved by sheet Ekstra, the page number is in cell I1 sheet Ekstra.
Someone who can help. All help will be appreciated.
Best regards Klaus W
I got this help earlier
Now I really want it to be counted together how many sheets are to be saved by sheet Ekstra, the page number is in cell I1 sheet Ekstra.
Someone who can help. All help will be appreciated.
Best regards Klaus W
I got this help earlier
Save Sheet page VBA
Hi, I'm using this VBA code to save the sheets, this works really well. '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 =...
www.mrexcel.com
VBA Code:
Sub Rektangelafrundedehjørner1_Klik()
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", "Ekstra")
'Select specific sheets from workbook, the save all as PDF
Sheets(sheetArray).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=saveLocation, From:=1, To:=Sheets("Bestilling").Range("F1").Value + 2
Sheets("Indkøbsrekvisition").Select
Mail_workbook_Outlook
End Sub