Macro to ONE PDF worksheet from dropdown list

SunnyFlower123

New Member
Joined
Jul 31, 2017
Messages
4
I have a workbook that has 80 or so sheets that all roll into a summary statement via vlookups/sumifs/and other formulas.

Currently have around 20 divisions that need to have statements PDF'd which I currently do one-by-one.

the drop down list is in sheet name ("Cheat Sheet") range (H2:H26)

drop down cell is in Sheet name ("Summary") R2

Print area is in Sheet name ("Summary") range B1: O55

Would like to have ONE PDF from print area of each division in the drop-down list and save the file to a designated location with a name "Summary"& cell (O4) from Sheet name ("Summary") . plus, I also need a page number that in the same order as the drop down list.

Appreciate any help.

now, i have a code that works to print pdfs for each divison, but i need a combined one with page number.

Code:
[/COLOR]Sub Print_All_Divison2_works() Dim rngLoopRange As Range
   Dim wsSummary As Worksheet
   Dim rngDealers As Worksheet
   
   Set wsSummary = Sheets("summary")


   For Each rngLoopRange In Worksheets("Cheat Sheet").Range("H2:H26")
      wsSummary.Range("R2").Value = rngLoopRange.Value
      
      wsSummary.ExportAsFixedFormat _
               Type:=xlTypePDF, _
               Filename:="C:\Divison PDF\" & rngLoopRange.Value & ".pdf", _
               Quality:=xlQualityStandard, _
               IncludeDocProperties:=True, _
               IgnorePrintAreas:=False, _
               OpenAfterPublish:=False
   Next rngLoopRange
   
   Set wsSummary = Nothing

End Sub[COLOR=#333333]
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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