+ Reply to Thread
Results 1 to 4 of 4

Printing multiple ranges in multiple worksheet into a single printout

  1. #1
    Registered User
    Join Date
    02-23-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    6

    Printing multiple ranges in multiple worksheet into a single printout

    Hi,

    I have a workbook containing multiple worksheets having multiple ranges (same range names on each worksheet). I'm trying to find a way to loop through each worksheet and print each defined ranges on it (only the data of each worksheet changes) with a different page number.

    Since the end result can be 50 pages or more, I would like to combine into one single printpreview, printout (for a pdf printer) or directly to pdf. The single printout combination is really my issue since I am able to launch all pages separately.

    Is there someone who know how I can achieve this?

    Thanks!

  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: Printing multiple ranges in multiple worksheet into a single printout

    Can't you just set the "Print Range" on each sheet to just the specified range (or whatever you want on each sheet), then select the sheets wanted all at once and "print selected sheets". That would print them all into a single print job. Right?
    _________________
    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
    Registered User
    Join Date
    02-23-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Printing multiple ranges in multiple worksheet into a single printout

    Hi,

    In fact, I am verifying that there is data in the range. If not, it is not printed. This is why your suggestion would not work.

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

    Re: Printing multiple ranges in multiple worksheet into a single printout

    You will need to adapt the macro to "do your test" on each worksheet, but this is the basic syntax for cycling through all the worksheets, doing a test, and adding sheets to an array of sheetnames. Then the array of sheetnames is selected and all printed as a single print job with the default printer.

    Please Login or Register  to view this content.

    Your test could be as simple as making sure there are cells in the range with something in them:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-23-2012
    Location
    Montreal
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Printing multiple ranges in multiple worksheet into a single printout

    Hi again,

    Here is a sample workbook to help explaining. In this exemple, I would only need to print the worksheet "FIRST" with "Cost 2011" since there is a total and "Cost 2012" on worksheet "SECOND" (since there is a total). There would be a total of 2 pages to be printed (same batch since this is only an example and it can be 50, 100 pages).

    Thanks!Attachment 174598

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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