+ Reply to Thread
Results 1 to 3 of 3

Macro to Print Multiple (Selective) Excel sheets to One PDF

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Tennessee
    MS-Off Ver
    Excel 2010
    Posts
    1

    Macro to Print Multiple (Selective) Excel sheets to One PDF

    Hi all,

    I am new to code and trying to figure out how to print multiple pages to PDF. I have sifted through other posts and found how to make it work when you have specific set pages to print. My problem is that I am trying to only print certain pages according to the iinformation in a particular cell on each sheet. I have the code to actually print out the worksheets tied to a button on my cover page and everything works great. When i tried to convert the code over to print to PDF I have had nothing but problems. I have included what I have for printing below. Can anyone help me convert this to print to pdf?

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 02-20-2013 at 03:27 PM. Reason: Added code tags, as per forum rules. Don't forget!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to Print Multiple (Selective) Excel sheets to One PDF

    My best recommendation is to:

    1) Create a temporary wb
    2) Check each of these pages in you current wb and if that sheet/range needs to be printed, copy that sheet/range to a new sheet in the new wb
    3) Repeat for all sheets in main workbook, thus creating a new wb with all the sheets/ranges wanted only
    4) Print the temp workbook as a whole to a PDF
    5) Close the temp wb without saving it
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Macro to Print Multiple (Selective) Excel sheets to One PDF

    Perhaps rather than using .PrintOut, change each sheet to
    Please Login or Register  to view this content.
    And then Print the Workbook instead of sheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1