+ Reply to Thread
Results 1 to 5 of 5

'Uncheck' option button on second click?

  1. #1
    Registered User
    Join Date
    08-26-2014
    Location
    A Sea Container
    MS-Off Ver
    2016
    Posts
    14

    'Uncheck' option button on second click?

    Hi,

    I am having a bit of a hard time figuring out the best way to handle this problem. I have tried using both form control (no good as I need code to execute on click) and ActiveX checkboxes and option buttons to achieve my objective, which is this:

    I have a sheet with a list of option buttons/checkboxes the user needs to click in order to show or hide the sheets they need. I have instances where multiple options are linked to a single sheet and need to be grouped so that only one option can be selected at a time, so I can't use checkboxes. However, I also need the user to be able to easily 'uncheck' an option button if they make a wrong selection. Ideally, by clicking the option button again, as you would with a checkbox. Is there a way to do this? I couldn't find anything in my extensive google searching.

    NB: Even though the grouped options link to one sheet, I still need the user to make a distinct selection so that the linked cell can pass the details of the selection to the sheet.


    To summarise, I need one of the following:

    *ActiveX checkboxes that unhide a sheet when checked, and re-hide it when unchecked (I have this part working)
    *a way to group some of the checkboxes so that only one selection can be made at a time

    OR


    *Form control checkboxes that unhide a sheet when checked, and re-hide it when unchecked


    OR

    *ActiveX option buttons that unhide a sheet when checked, and;
    *a way to uncheck the option button with a click when a wrong selection is made

    Whatever option is chosen, the buttons/checkboxes need to also link to a cell on the sheet.



    I hope this makes sense, and as always, thanks in advance for any help and advice you can provide.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: 'Uncheck' option button on second click?

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    08-26-2014
    Location
    A Sea Container
    MS-Off Ver
    2016
    Posts
    14
    Thank you, I will do that tomorrow.
    Last edited by AliGW; 01-10-2021 at 04:28 AM. Reason: PLEASE don't quote unnecessarily!

  4. #4
    Registered User
    Join Date
    08-26-2014
    Location
    A Sea Container
    MS-Off Ver
    2016
    Posts
    14

    Re: 'Uncheck' option button on second click?

    Sample workbook - hope this will suffice:
    Attached Files Attached Files

  5. #5
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: 'Uncheck' option button on second click?

    The code on the four option buttons should be self explanatory.
    I am not sure whether you needed to select more than one in each column.
    At the moment I have in 'Properties' set each option box to be grouped per column.
    If you want each option to be selectable you will have to set each option button group to something unique.
    The toggle on/off is activated by the 'mousedown_event' > over option button hold down left mouse button > move off option button and release left mouse button.
    torachan.
    Attached Files Attached Files

+ 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 click
    By rup1234 in forum Excel General
    Replies: 1
    Last Post: 10-31-2018, 07:51 AM
  2. Get element by value? [click on option button on web page]
    By emjay973 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2017, 05:52 PM
  3. Running the code in an option button from a seperate normal button click
    By camikhazi in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-22-2016, 10:54 AM
  4. Option button click ... then focus back to sheet ?
    By dannac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2012, 02:05 AM
  5. Option button click with if else statment
    By peedarp1985 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-03-2010, 12:11 AM
  6. Uncheck Check Box + check a option button using Command Button
    By Carlsbergen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2009, 03:09 AM
  7. Check AND uncheck an option button
    By pingwin77 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-14-2008, 09:38 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