PDF multiple worksheet based on Cell values

Don_duck

New Member
Joined
Aug 15, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Good morning All.
First time poster, but have used the forum and associated code more time then I care to admit!

Unfortunately, I have not been able to find/modify code to achieve what I want to do.
I have workbook that has a number of sheets (for this example, they are named Item1 to Item8). I also have a Summary sheet.

On this summary sheet, there are four list that I populate using data validation drop down lists. These values are named the same as the various worksheets.

What I am trying to achieve is a single button click, that will take the range of cells above it on the Summary page (Eg. for List1 it would be B2:D16, List2 would be F2:H16 etc etc) convert it to a PDF, but also PDF the sheet that is listed in the "item field", nothing that these items change between lists. This one PDF would then be attached to an email to be sent off to HQ.

For Example, when I click the Submit button at the bottom of "list1" on the summary page
  • Summary B2:D16 is made into page 1 of a PDF
  • The print area of Sheet "Item2" is made into page 2 of the PDF
  • The print area of Sheet "Item3" is made into page 3 of the PDF
  • If there were more items listed, the would form subsequent pages.
  • The entire PDF is then emailed.
Once I have the code for List 1, I can substitute for list 2, 3 and 4

I hope this makes sense, and someone is able to help me out.

Thanks.

Example 1.xlsx
ABCDEFGHIJKLMNOPQ
1
2List 1List 2List 3List 4
3ItemField1Field 2ItemField1Field 2ItemField1Field 2ItemField1Field 2
4Item2Item1Item4Item8
5Item3Item5Item7
6Item6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Summary
Cells with Data Validation
CellAllowCriteria
B4:B16List=data!$A$2:$A$9
F4:F16List=data!$A$2:$A$9
J4:J16List=data!$A$2:$A$9
N4:N16List=data!$A$2:$A$9
 

Attachments

  • Capture.JPG
    Capture.JPG
    117.1 KB · Views: 15

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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