+ Reply to Thread
Results 1 to 5 of 5

A Print code to choose the print page

  1. #1
    Forum Contributor
    Join Date
    05-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007
    Posts
    144

    A Print code to choose the print page

    Dear All,

    I have designed a report which spans two pages, and I have the vba code below to enable me and other users to print the two pages when the need arises.

    I set up a print area for the two pages (combined) as follows: A12:P74 – [see print area in code below]:

    Please Login or Register  to view this content.
    The above code is intended to print both pages 1 and 2 of a report.

    However, it is not all the time that a user might want to print all two pages of the report. There may be times when a user might wish to print –

    Either (a) Page 1 only which goes from A12:P49

    Or (b) Pages 1 and 2 – which is the entire defined print area of A12:P74

    If it is possible, please, I would like to incorporate, in the code, a choice to be able to print either only page one or print both pages. I would be glad if the above code could be tweaked to help me to achieve that.

    I should be grateful for your kind help with this.

    Thanks.

    Newqueen

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

    Re: A Print code to choose the print page

    Something like this maybe?
    Please Login or Register  to view this content.
    Or a small UserForm with radio buttons for a selection would look nicer.

    BTW, why a "Do Not Print" Choice? Not using the print button will accomplish the same thing I would think.
    Last edited by jolivanes; 05-28-2018 at 06:04 PM. Reason: Fix sheet name(s)

  3. #3
    Forum Contributor
    Join Date
    05-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007
    Posts
    144

    Re: A Print code to choose the print page

    Thanks Jolivanes for your prompt and kind response. The code you provided solves the problem perfectly. I am truly very grateful to you for your kindness.

    Meanwhile, it would be very nice to try your other options. My vba is at a very baby level. But if you can give me something to try on those options, I will be glad to do so, and might use one of those.

    Again, thanks for your help.

    Newqueen.

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

    Re: A Print code to choose the print page

    Play around with attached. Who knows, you might like it better.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    05-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007
    Posts
    144

    Re: A Print code to choose the print page

    Thanks very much Jolivanes. I will try your attached file.

    Again, you have been very wonderful.

    Newqueen

+ 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. Macro slows down when I print/print preview/page break a sheet
    By Grug in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-07-2015, 08:59 PM
  2. Replies: 1
    Last Post: 06-20-2014, 02:42 PM
  3. VBA print code to pop up msgbox if I choose a non existing printer
    By loroverde in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2014, 01:16 PM
  4. VBA for print if cell contains, then choose printer. Have code just need advice.
    By lukestkd in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-10-2012, 08:39 PM
  5. Replies: 4
    Last Post: 02-17-2006, 08:36 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