+ Reply to Thread
Results 1 to 10 of 10

Excel Option Button refuses to work

  1. #1
    Registered User
    Join Date
    06-21-2007
    Posts
    28

    Excel Option Button refuses to work

    Read so much option button help today that doesn't work I'm about to chuck the project. All I want to do is create a group of 3 option buttons in an excel worksheet for a user to select one of two farm programs or none. (CIG or MRP or None) When a user makes a selection either CIG or MRP or None appears in a designated cell. I even used code in the VB editor help but it only shows how to operate one button (which is absurd.) I found an example using 2 buttons, but that wouldn't work either. Found a tutorial using 3 buttons and that wouldn't work. Is this a conspiracy? Every time I try to find help to do something simple in excel lately I hit a brick wall. All I find in excel help is complex examples. Is simplicity dead? Don't get me started on macros.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    You have not explained what you want to occur when a user selects an option
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Create three option buttons from the Forms toolbar. Right-click any of them, select Format Control, and assign a cell link, say A1 (they all link to the same cell).

    In another cell, =CHOOSE(A1, "CIG", "MRP", "None")

    Simplicity lives.

  4. #4
    Registered User
    Join Date
    06-21-2007
    Posts
    28

    Simple Option Button

    Thanks a million. That's excellent. But excel exacts its pound of flesh: The frame and option buttons are transparent and move independently of each other. I've tried all I know and so far no luck. It looks weird with the gridlines showing through.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You're not trying hard.

    The frame and option buttons are transparent ...
    Format Control, Color and Lines, pick a fill color you like.
    ... and move independently of each other
    Select the Group Box and each of the option buttons while holding the Ctrl key to multi-select. Right click, Grouping, Group.
    Last edited by shg; 04-13-2008 at 12:23 AM.

  6. #6
    Registered User
    Join Date
    06-21-2007
    Posts
    28

    Option Button Format

    That's the first thing I tried. I selected the group box then clicked Format>Control. A Format Control group of tabs opens. Tabs are Size, Protection, Properties, Web, Control. None of these tabs have the color or other common format options that are usually available in properties. I then selected each button and got the same results when I click Format Control. I tried everything in my limited bag of tricks to get to a properties menu without success. I'm using excel 2002 (10.6841.6839) SP3. I even promised excel some hagen daas sprinkled with crunchy numbers. Apparently excel doesn't bribe easily, gives up its secrets begrudgingly and loves to confounds brilliant minds.

  7. #7
    Registered User
    Join Date
    06-21-2007
    Posts
    28

    Formatting Option Buttons

    I just discovered that the Format Control only offers Lines and Colors when the button is first placed onto the worksheet and before any type of code has been inserted. After code has been inserted a different set of options become available in Format Control, none of which offer Lines and Color.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I just discovered that the Format Control only offers Lines and Colors when the button is first placed onto the worksheet and before any type of code has been inserted.
    Interesting. Not so with Excel 2003.
    Apparently Excel doesn't bribe easily, gives up its secrets begrudgingly and loves to confounds brilliant minds.
    “Nothing in this world can take the place of persistence. Talent will not; nothing is more common than unsuccessful people with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination alone are omnipotent. The slogan "press on" has solved and always will solve the problems of the human race”

    Calvin Coolidge, 1872

  9. #9
    Registered User
    Join Date
    06-21-2007
    Posts
    28

    Fickle Form Control

    After your instructions I tried an experiment: created a new frame. The Line and Color tab was still not available in the Form Control. Created a new option button and the L & C tab was available for buttons. Deleted the 3 existing buttons and created 3 new buttons and placed them inside the frame. The L & C tab was still available to the buttons. Conclusion for excel 2002: L & C is never available for frames, aka group boxes. If at first L & C is not available for option buttons delete them, create new buttons and start again until the L & C tab is part of the form control for buttons. Excel glitch? Before discovering this I found a cheap way around the transparent frame problem: I colored the cells behind it. Of course lines were not available for the option buttons. Thanks for your help. Have a great weekend.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    You could instead use ActiveX controls from the Control Toolbox, which offer more options for formatting, at the expense of requiring some VBA to automate.

    Or, if your requirement is a simple as a few option buttons, you could use Marlett checkboxes, implement your own groupings, and have all of the cell formatting options available.

    Excel offers many ways to skin a cat, even if you can't find the exact Cat Imperial recipe you're looking for.

    Have a great weekend.
    Thank you, and you as well.

+ 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