Counted how many sheets are to be saved

KlausW

Active Member
Joined
Sep 9, 2020
Messages
378
Office Version
  1. 2016
Platform
  1. 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

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
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,214,965
Messages
6,122,499
Members
449,089
Latest member
Raviguru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top