+ Reply to Thread
Results 1 to 2 of 2

Change Option Buttons Based on Checkboxes in Userform

  1. #1
    Registered User
    Join Date
    07-12-2014
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    67

    Change Option Buttons Based on Checkboxes in Userform

    Hey all,
    So here's what I already have coded successfully:

    In Frame 1 I have option buttons for:
    • All Days
    • Weekdays
    • Other

    and in Frame 2 I have Checkboxes for
    • Monday
    • Tuesday
    • Wednesday
    • Thursday
    • Friday
    • Saturday
    • Sunday

    So far, I've made it so that when you click the "All Days" option, checks in the Monday - Sunday boxes automatically appear
    when you click the "Weekdays" option, checks in the Monday - Friday boxes automatically appear
    when you click the "Other" option, all checkboxes are set to false so the user can select individual days.

    What I need, is for the option buttons to change with the checkboxes. So if the user clicks "Other" but checks the Monday - Friday boxes, then the "Weekdays" option would switch to "true". If all of the days are checked, the "All days" option button would be set to "True". If any combination of days other than Mon-Fri and Mon-Sun are checked, then the "Other" option would be set to "True".

    Essentially, the Option buttons change the check boxes only. I need the Option buttons to change the check boxes and the check boxes to change the Option buttons.

    Here's the code so far:
    (option buttons are OptAllDays, OptWeekdays, and OptOther)

    Thank you!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Change Option Buttons Based on Checkboxes in Userform

    Hi SoothSailor,

    There are two issues we have to solve:
    a. Getting the logic correct.
    b. Preventing the CheckBoxes/OptionButtons from cross-pollinating each other. The cross-pollination problem is the reason for the Global boolean variable.

    By definition, CheckBoxes are independent and don't need to be in a Frame. The OptionButtons can be in a Frame or they can be in the same Group. The Group Property can be assigned in the 'Properties' Window by assigning all the OptionButtons in the group to the same Group Name.

    Lewis

    Try replacing your UserForm code that you posted with the following (tested and working):
    Please Login or Register  to view this content.
    Last edited by LJMetzger; 10-22-2014 at 03:20 PM. Reason: Added Frame Paragrahp

+ 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. [SOLVED] Adding change event to dynamically created option buttons on userform
    By Arkadi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2014, 11:38 AM
  2. [SOLVED] Populate userform radio (option) buttons based on data in worksheet
    By d.sanchez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2013, 01:21 PM
  3. [SOLVED] Disable frames & option buttons on userform based on today's date
    By raj.bris in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-02-2013, 01:05 AM
  4. [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
  5. Checkboxes vs. Option Buttons
    By JW_4222 in forum Excel General
    Replies: 2
    Last Post: 02-01-2006, 09:40 AM

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