+ Reply to Thread
Results 1 to 9 of 9

Toggle Button to Clear Option Buttons

  1. #1
    Registered User
    Join Date
    03-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    Toggle Button to Clear Option Buttons

    Hello,

    I am looking for some help on this issue. I have a worksheet with a series of Toggle Buttons. Each Toggle Button will display "No" when not selected and "Yes" when selected. Beside each Toggle Button, there is a set of Option Buttons in a Group Box. Currently, to uncheck an Option Button, I have a Command Button to clear them all. What I would like to happen is, when a Toggle Button displays "No", I would like the set of Option Buttons next to it to be inactive and cleared. Is this possible? I have attached my sheet.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Toggle Button to Clear Option Buttons

    Try linking the option button groups to a single cell and then clear that cell to reset them.

    For example if you linked OptionButton8 & 9 to H20 you could use this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Toggle Button to Clear Option Buttons

    Hi nwb

    Is this what you have in mind?
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    03-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Toggle Button to Clear Option Buttons

    jaslake,

    I did not have sucess replacing the code. I am unaware what the "i" corresponds to having a value of "8 To 9".

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Toggle Button to Clear Option Buttons

    Hi nwb

    Option Buttons 8 and 9 are the Option Buttons directly to the right of Toggle Button 12...

  6. #6
    Registered User
    Join Date
    03-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Toggle Button to Clear Option Buttons

    My apologies. I inserted the code into the original document which, for some reason has different Option Button names. That works GREAT! Do you know if i can acctually have the option button disabled until the toggle button is pressed to say "yes" ? Other than that, its does as i asked.

    Thank you so much!

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Toggle Button to Clear Option Buttons

    Hi nwb

    You can try this (Code in the attached)...

    Initially set the state of the Option Buttons to disabled and set the Caption of the Toggle Buttons to "No" with this Code in a General Module
    Please Login or Register  to view this content.
    Then replace the Toggle Button Code with this
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jaslake; 04-09-2014 at 04:24 PM.

  8. #8
    Registered User
    Join Date
    03-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Toggle Button to Clear Option Buttons

    Sorry for the delay in my response. Your solutions above works amazing! Thank you so much!

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Toggle Button to Clear Option Buttons

    Hi nwb

    You're welcome...glad I could help.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    If this resolves your issue please mark your Thread as SOLVED.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:
    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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. Option button to toggle msgbox
    By hockeyadc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-27-2013, 06:38 PM
  2. [SOLVED] VBA to copy/clear rows based off option buttons/checkboxes
    By CWicklund in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2013, 03:41 PM
  3. Replies: 2
    Last Post: 03-27-2007, 08:30 AM
  4. Clear Option Buttons
    By jfro in forum Excel General
    Replies: 0
    Last Post: 01-24-2005, 12: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