+ Reply to Thread
Results 1 to 6 of 6

print pages in specific order in vba macro

  1. #1
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    print pages in specific order in vba macro

    I have the formula to print range of pages but I need to vary that dynamically depending on number of pages. I am running a sport tournament and want to printout page 1 alone then print page 2 thru ?

    Here is the command I found by google:

    [code]Worksheets.PrintOut from:=1, to:=1[\code] oops - this code didn't compile

    I'd like to run the macro with the page 1 values hard coded just as it shows, but then would like to use same command and print pages 2 thru ??.

    ** The last page will be in range 2 thru 11.

    Can I substitute a variable for the last page value?

    Since the command I found on Google didn't work can anyone help with issuing 2 printout commands
    One to print page 1 only
    Then 1 to print page 2 thru ???

    I need this so I can get participants on page 1 started as soon as possible due to limited time available.

    I won't need to issue two print commands if I can print in the order first page to last (variable) page.

    Thanks for your help.
    Last edited by pongmeister; 04-16-2016 at 06:20 PM.

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: print pages in specific order in vba macro

    Try here: Excel Programming / VBA / Macros

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: print pages in specific order in vba macro

    Hi pongmeister

    I'm assuming when you refer to "Page" you're actually referring to Worksheets. If so, try this.

    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: print pages in specific order in vba macro

    Jaslake, Thanks for your response - I don't think my explanation was very good, but I only want to print the worksheet that I invoke the macro from. I just want to be able to control in vba the order in which I print each page.
    So the print area may contain 2 page breaks and 15 rows after the second, then I want to print from page 1 to page 3 from the activesheet.

    I've tried using this command:

    Please Login or Register  to view this content.
    but I have gotten syntax errors. I didn't have the from and to parameters coded as you did in your response and as I copied in mine.

    Can you advise on whether the code using Activesheet will work?

    Thanks again
    Last edited by pongmeister; 04-18-2016 at 12:41 AM.

  5. #5
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: print pages in specific order in vba macro

    Jaslake,

    I used your syntax and that worked perfectly. Thanks for your help, much appreciated! I will mark this post solved.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: print pages in specific order in vba macro

    You're welcome...glad I could help. Thanks for the Rep.

+ 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. Need vba code to print specific pages or all pages in a multipage UserForm
    By Pimp_mentality in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-24-2020, 08:13 PM
  2. Replies: 2
    Last Post: 08-29-2016, 01:36 PM
  3. Macro to print specific pages in a single worksheet (2007)
    By nibandit21 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2016, 12:49 AM
  4. [SOLVED] Print Macro to email PDFs of specific pages of a workbook to specific recipients
    By mike_vr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2012, 12:34 PM
  5. How do I set a manual print order for pages across multiple sheets
    By Xori in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-20-2012, 09:48 AM
  6. [SOLVED] Print pages in a different order
    By dlb1228 in forum Excel General
    Replies: 2
    Last Post: 02-23-2006, 05:35 PM
  7. Replies: 3
    Last Post: 07-15-2005, 11:05 AM

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