+ Reply to Thread
Results 1 to 11 of 11

Message box before printing with a Yes and No.

  1. #1
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    346

    Message box before printing with a Yes and No.

    Hi all

    I am in requirement of a message box which pops up before printing. Message box contains questions like "Have you verified the Totals?", "Have you verified the total count in Annex III and 6p?" etc., If answer is yes, then go ahead printing, if it is no,then abort the printing.

    I am attaching an image of what I intended.

    Your help will be much appreciated.
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Message box before printing with a Yes and No.

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-08-2006
    Location
    UK
    MS-Off Ver
    2013
    Posts
    204

    Re: Message box before printing with a Yes and No.

    *Edit* - code above is far better!

    Hi Ravana, I think you simply need some message boxes, followed by if statements. This isn't eloquent but would work:
    Please Login or Register  to view this content.
    You can then do an if statement after each messagebox, so if they click No then exit sub, else continue:
    Please Login or Register  to view this content.
    repeat for each question.

    or you could do a loop
    Please Login or Register  to view this content.
    Then at the end, all conditions have been met so you can go ahead with the print.
    Sorry, not had time to write the code out but it should provide a start.

  4. #4
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Message box before printing with a Yes and No.

    I think OP needs this - previous solutions just show how to create multiple messageboxes ; I think OP wants to show one message box, but didn't know how to impact printing on the yes/no outcome.

    Please Login or Register  to view this content.
    Put in the workbook code area.

    Please click the * below if this helps
    Please click the * below if this helps

  5. #5
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    346

    Re: Message box before printing with a Yes and No.

    Please Login or Register  to view this content.
    I used the code in ThisWorkbook sheet; even on saying no, it is still printing.

  6. #6
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    346

    Re: Message box before printing with a Yes and No.

    @JasperD...your code is ok with me.

    However, JOHN H. DAVIS code looks more elegant; it looks like system is asking me questions; so, if there is any change required in that code, do help me.

  7. #7
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Message box before printing with a Yes and No.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    346

    Re: Message box before printing with a Yes and No.

    @JasperD, after saying yes for every question, questions are repeating once again before printing.

  9. #9
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Message box before printing with a Yes and No.

    Remove 'activesheet printout'

  10. #10
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    346

    Re: Message box before printing with a Yes and No.

    @JasperD

    This code I am using in Workbook module, however, I require the prompting only for few particular sheets (like sheet3, sheet4, sheet5) and not to all sheets;

    Is there is a way?

  11. #11
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2021
    Posts
    346

    Re: Message box before printing with a Yes and No.

    I got it.

    Any tanx to all.

+ 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. [SOLVED] I need a message box to open up and display a message before printing.
    By Bobp84 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-16-2012, 01:34 PM
  2. [SOLVED] error message during printing
    By Urgent ! in forum Excel General
    Replies: 1
    Last Post: 02-01-2006, 01:10 PM
  3. Printing with a message
    By Rmagic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2005, 07:10 PM
  4. Printing on message box condition?
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2005, 08:05 AM
  5. Printing on condtion in message box?
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2005, 10:39 PM

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