Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jan 2002
    Location
    CT
    Posts
    361
    Thanks
    0
    Thanked 1 Time in 1 Post

    Yes / No Message Box Question (Excel XP)

    Is it possible to replace the words YES and NO on the buttons in a yes/no message with text other then YES and NO?

    I have a box set up with a multiple line explanation for pressing YES for one result or NO for another result.

    It could simplified a lot if the buttons said SHIP and PICKUP instead of YES and NO.

    Or, if this is not possible, is there a way to set up a message box that will have 2 or more buttons to choose from, one for each of the desired actions?

    I can set of a waning message box that has an OK button to press. I can also create these YES/NO message boxes as well as data input boxes, but have no experience beyond that.

    Thanks,
    BH

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Yes / No Message Box Question (Excel XP)

    The MsgBox function is very simple, it offers only a limited and fixed choice of button combinations.

    You can create a userform in the Visual Basic Editor and put command buttons on it with whatever caption you wish. Set the value of a global variable in the On Click event procedure of the command buttons; you can inspect the value of the variable in the code that displays the userform, and act accordingly.

  3. #3
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Yes / No Message Box Question (Excel XP)

    Hi BH

    As most people here will attest I am probably the least able person to offer advice!!

    It occured however to me that you could use option buttons inside a grouped box, in the quick example I have done here I have placed 2 options inside a grouped box Linked to B2 to get an either or either result.

    Any good?

    Steve
    Attached Files Attached Files
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  4. #4
    3 Star Lounger
    Join Date
    Jan 2002
    Location
    CT
    Posts
    361
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Yes / No Message Box Question (Excel XP)

    Steve,

    Hey.........that's pretty slick! I haven't seen anything like that in Excel. I tend to learn and see what I need to make something work and don't get outside my box much!

    Unfortunately it won't help here as I need this question asked during the running of a macro. If being "shipped" one set of proceedures takes place; if being "picked up" the macro follows a different path.

    Neat stuff though.........I'll certainly keep it in mind.

    BH

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Yes / No Message Box Question (Excel XP)

    The attached workbook shows how you can use a custom userform to act as a dialog with two buttons.

    The formatting of the form is rather garish. I wouldn't recommend using it like that, it's just meant to demonstrate that you can format the userform the way you like.

    (You'll need to enable macros when you open the workbook)
    Attached Files Attached Files

  6. #6
    3 Star Lounger
    Join Date
    Jan 2002
    Location
    CT
    Posts
    361
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Yes / No Message Box Question (Excel XP)

    Hans,

    That's pretty cool. I should be able to make it work.

    Thanks again!
    BH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •