+ Reply to Thread
Results 1 to 5 of 5

Control Radio Button With Conditions

  1. #1
    Registered User
    Join Date
    02-21-2011
    Location
    Lancaster, PA
    MS-Off Ver
    Excel 2007
    Posts
    33

    Control Radio Button With Conditions

    I have developed a costing model for our products. It includes a radio button that you can select if the product is put on a skid or not. This triggers several calculations that affect time to produce the product and other things as well. Due to the length of some of our products we cannot skid anything longer than 144". I was wondering if there is a way to lock the radio button in the "No Skid" position if the entered length of the product is greater than 144".

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Control Radio Button With Conditions

    Yes. Where does the user enter the length? On a worksheet, or on a userform? Where is the radio button located? Is it a Forms radio button or an ActiveX radio button?

    I have worked with ActiveX radio buttons and have more limited experience with Forms controls, so I'll describe what you would do with ActiveX controls.

    If this is on a worksheet you would use Worksheet_Change to capture changes on the sheet. If length is entered, and it is over 144, then the code would set the radio button value to False and then set the Enabled attribute of the radio button to False. If the length is <=144 then you would set the Enabled attribute to True.

    As always, if you attach your file we can give you a more specific solution.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    02-21-2011
    Location
    Lancaster, PA
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Control Radio Button With Conditions

    The length and radio buttons are both on the same worksheet. The radio buttons were created from the commands in the Developer tab so I don't believe they are ActiveX. Also, below 144" I want the ability to select skidded or not skidded.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Control Radio Button With Conditions

    Another option would be to use a drop down list instead of the radio (option) buttons.

    I assume the option buttons include "Skid" and "No Skid".

    You could use a drop down list based on the length value. If the length is <=144 then the drop down list would have both selections available. If the length is >144 then the only selection would be "No Skid".

    OTOH, option buttons look better!
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Control Radio Button With Conditions

    Quote Originally Posted by dblcrona View Post
    The radio buttons were created from the commands in the Developer tab so I don't believe they are ActiveX.
    The Developer tab for worksheets has both Forms and ActiveX controls available.

    If you attach your file I (or someone) can just do the fix for you, though if it's a costing model be sure to remove any proprietary data.

+ 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. Replies: 3
    Last Post: 08-28-2013, 05:39 AM
  2. ActveX Control Button Not Working But Form Control Button is
    By MikeTruth in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-31-2012, 05:04 AM
  3. Uncheck Radio Button using a Command Button
    By earl54dink in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-08-2008, 05:47 PM
  4. Pressing one radio button to select another radio button
    By raehippychick in forum Excel General
    Replies: 1
    Last Post: 09-13-2007, 11:30 PM
  5. [SOLVED] How to control radio buttons on a web page?
    By festdaddy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-25-2006, 07:20 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