Save multiple sheets to single pdf based on cell reference

hitch23

New Member
Joined
Nov 9, 2011
Messages
1
I would like to have a macro that will save 2 worksheets to a single pdf. The workbook contains 12 worksheets. One worksheet is titled "Home" and contains cells for entering values that are used by Vlookup functions to pull data from another Excel file and populate cells in the other worksheets. In the "Home" sheet I type in a service order number(example: 12104) into cell F12 and a sequence number (example: 12) into F15. In cell S20, I enter the name of an existing folder where I want the pdf to be saved to(example: Stork). Another sheet in this workbook is titled "Temp-5 pg-1 pdf" and is the first page I would like to save in the pdf file. Cell F20 contains a serial number(example: 9601057). Can you please help me with the code to save two sheets named "Temp-5 pg-1 pdf" and "Temp-5 pg-2 pdf" into one pdf file named as the service order number-sequence number-serial number and saves it to P:\Orders 2011\PDF Certs\"Customer name" (example: 12104-12-9601057 saved to P:\Orders 2011\PDF Certs\Stork)

Can this be done in one macro? Does it matter that cell F20 (the serial number) is a result of a vlookup function and not a number or text? Do I have to copy the vlookup result and "paste value" into another cell first?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,207,255
Messages
6,077,313
Members
446,278
Latest member
hoangquan2310

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