+ Reply to Thread
Results 1 to 6 of 6

Print multiple worksheets to PDF

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Print multiple worksheets to PDF

    Hello,
    I have the following script to print multiple worksheets to PDF:
    Please Login or Register  to view this content.
    However, I am only getting one worksheet page in the PDF file.
    Could you please advise, what is wrong here?
    Thanks

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Print multiple worksheets to PDF

    if your array is working then

    ActiveSheet.ExportAsFixedFormat
    change to
    ActiveWorkbook.ExportAsFixedFormat
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Print multiple worksheets to PDF

    You should use Debug.Print worksheetstoprint to make sure that you setup the array correctly.

    The 2nd sub shows another selection method. Add Worksheets(indexnumber) rather than Worksheets(worksheetname) in an index loop like you did.
    Please Login or Register  to view this content.
    Last edited by Kenneth Hobson; 05-24-2016 at 09:08 PM.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Print multiple worksheets to PDF

    Please Login or Register  to view this content.
    see the ....hide sheet you don't want to print, then unhide everything at the end method
    Last edited by humdingaling; 05-24-2016 at 09:11 PM. Reason: updated code

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Print multiple worksheets to PDF

    This is the way I do it.
    Change all references as required.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Print multiple worksheets to PDF

    humdingaling,
    Nice! "Hiding" and "Unhiding" the sheets did the trick, simple, and ingenious.
    Thanks a lot!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Set multiple print areas on worksheets!
    By meus in forum Excel General
    Replies: 2
    Last Post: 11-18-2015, 05:20 AM
  2. Excel 2010 multiple worksheets print to multiple pdf 's is there a macro for this?
    By fontana in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2012, 01:40 PM
  3. Macro to print multiple worksheets to multiple PDFs.
    By ryanwood17 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-14-2010, 02:07 AM
  4. Print Multiple Worksheets into one PDF.
    By abhay_547 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-13-2010, 10:48 PM
  5. Print certain names from multiple worksheets
    By dizzylime in forum Excel General
    Replies: 1
    Last Post: 09-11-2009, 11:36 PM
  6. How to print multiple worksheets in A4 paper?
    By josepheng88 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-20-2008, 08:13 PM
  7. How do I print a spreadsheet with multiple worksheets?
    By Need Help in forum Excel General
    Replies: 1
    Last Post: 05-23-2006, 05:25 PM

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