+ Reply to Thread
Results 1 to 15 of 15

What Page You Want to Print VBA code

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,745

    What Page You Want to Print VBA code

    Hello,

    I have about ten pages on my worksheet. I just want Page 1 and 3 to print except the rest of the pages.

    Thank you.

    Please Login or Register  to view this content.

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

    Re: What Page You Want to Print VBA code

    When you say pages, do you mean sheets?
    One sheet can have multiple pages.
    If you want to print page1 and page 3 of sheet1, hide everything except these pages.
    If you want to print 2 sheets, select these sheets and print.
    Both no problem with a macro.

    Let us know what it is going to be.
    Experience trumps academics every day of the week and twice on Sunday.

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

    Re: What Page You Want to Print VBA code

    Read your request again. It is pages of one sheet.
    See if this works for you.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,745

    Re: What Page You Want to Print VBA code

    Hi
    You can?t add code the page 1 to print only from the originalcode?

    maybe from this code?
    ActiveSheet.PrintOut copies:=prtQty

    thanks

  5. #5
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: What Page You Want to Print VBA code

    Quote Originally Posted by RJ1969 View Post
    I have about ten pages on my worksheet. I just want Page 1 and 3 to print except the rest of the pages.
    Hello. Try with:

    Please Login or Register  to view this content.

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

    Re: What Page You Want to Print VBA code

    Hardcoded page numbers.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,745

    Re: What Page You Want to Print VBA code

    Hi

    With this code:

    Please Login or Register  to view this content.
    Can you add an input box "What pages you want to print"? That's after the "print Quantity".

    So this way, I can decide what pages I want to print instead.

    thank you.

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

    Re: What Page You Want to Print VBA code

    In Post #1 you say "Page 1 and 3" which excludes Page 2
    Is that not true anymore and now you want "From Page1 To Page3"?

  9. #9
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,745

    Re: What Page You Want to Print VBA code

    Hi
    That was my previous request that I wanted just to print 1 and 3.
    But I am thinking ahead that I wanted to add an input box for what pages to print. Just in case I decided to print page 4 and 9 or whatever pages I desire to print. Is it possible to add an input box in the code below?

    Thank you.


    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: What Page You Want to Print VBA code

    For example:

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,745

    Re: What Page You Want to Print VBA code

    Ok great!

    What if i am want or decided to print the entire pages?
    Do i put ?all??

  12. #12
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: What Page You Want to Print VBA code

    Quote Originally Posted by RJ1969 View Post
    What if i am want or decided to print the entire pages? Do i put all??
    A little adjustment:

    Please Login or Register  to view this content.

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

    Re: What Page You Want to Print VBA code

    Like so you mean?
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,745

    Re: What Page You Want to Print VBA code

    Perfect! Thank you so much.

  15. #15
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: What Page You Want to Print VBA code

    Quote Originally Posted by RJ1969 View Post
    Perfect! Thank you so much.
    Ok. I hope you can put it to good use.

+ 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. Flexible print page VBA code
    By Mare_23 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2020, 03:11 AM
  2. [SOLVED] A Print code to choose the print page
    By newqueen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2018, 08:48 PM
  3. Code Go To in Last Page In Print Preview
    By Jhon Mustofa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2018, 01:12 PM
  4. vba code for print 2 format on a same page
    By ajitdoley in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 06-28-2016, 11:29 PM
  5. [SOLVED] VBA Code to print one page at a time
    By jmcole in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-11-2015, 07:21 PM
  6. VBA code for formatting a page to print
    By ATLGator in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2012, 03:14 PM
  7. Print chosen page code
    By Elvisman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2010, 09:43 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