+ Reply to Thread
Results 1 to 6 of 6

Option button to toggle msgbox

  1. #1
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    80

    Option button to toggle msgbox

    I have 2 groups of option buttons. When the user clicks on a specific combination, I want an error message to pop up. How can I go about coding this?

  2. #2
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Option button to toggle msgbox

    you might have to have the buttons "trigger" a checkbox or input a number into a cell so if you have say 5 buttons and the error is triggered by pressing button 1, 4, 3 then button press 1 will put a 1 in say z1, press button 4 will put a 4 in cell z2 and press button 3 will put a 3 in cell z3. then write a formula to look at cells z1, z2, and z3 like

    of course you will have to change the If sumerr = 143 part to include all error combos like If sumerr = 143 or sumerr = 413Then MsgBox "Error"

    errx is for each button, each button should have a unique number associated with it

    Please Login or Register  to view this content.
    then write code so that if you click the button it will put the number in the z column example codes for CommandButton1
    Please Login or Register  to view this content.
    Last edited by scott.s.fower; 02-27-2013 at 06:21 PM.

  3. #3
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Option button to toggle msgbox

    is there going to be a submit button or do you just want it to do it automatically? also what do the buttons do? it might help me to give you a better idea

  4. #4
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Option button to toggle msgbox

    Personally I would just assign macros to the ones that cannot be combined telling them to check the state of the others and return an error message box (and reset the buttons) if the wrong combination is present.

  5. #5
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: Option button to toggle msgbox

    I wanted it to do it automatically, so there really wasn't a macro to initiate. I actually figured it out though. I wrote a macro and assigned the option buttons to it, so as they click on them it "automatically" makes sure its a valid combination.

    Thanks for the help guys!

  6. #6
    Registered User
    Join Date
    11-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: Option button to toggle msgbox

    Quote Originally Posted by Hawkeye16 View Post
    Personally I would just assign macros to the ones that cannot be combined telling them to check the state of the others and return an error message box (and reset the buttons) if the wrong combination is present.
    This is what I did thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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