+ Reply to Thread
Results 1 to 9 of 9

Change combobox list based on option button

  1. #1
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,042

    Change combobox list based on option button

    I have two buttons:

    Please Login or Register  to view this content.
    And code below:

    Please Login or Register  to view this content.
    By default:
    Optionbutton1=False
    Optionbutton2=True

    and 3 steps:

    When I run User form - it's OK (looking at List 1)
    When I click Optionbutton1 - it's OK (looking at list 2)
    When I now click back to Optionbutton2 it remains at List 2.. Why doesn't switch to List1?
    Last edited by zbor; 05-09-2012 at 09:50 AM.
    Never use Merged Cells in Excel

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Change combobox list based on option button

    could you attach workbook with dummy data ?

    I modified your code into this, I hope it is what you need
    Please Login or Register  to view this content.
    Last edited by MaczaQ; 02-21-2012 at 05:27 AM. Reason: add code
    Best Regards
    MaczaQ
    ---------------------------------------------------------------------------------------------------------------------------
    If you are satisfied with the solution(s) provided, please mark your thread as Solved
    If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
    - This way you will add him some reputation points ... thanks in advance.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,042

    Re: Change combobox list based on option button

    Thx maczaQ!

    CmbSiteName.Clear did the trick...
    I left rest of previous code because it create 2 columns in combobox.

    I can upload file when I finnish it

  4. #4
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Change combobox list based on option button

    my code creates two columns too (without for each loop)

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,042

    Re: Change combobox list based on option button

    hmm.. didn't work for me at the first time... I'll take a look again... Probably I need to redefine lists.

  6. #6
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Change combobox list based on option button

    of course your list1 and list2 should be range for 2 columns

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,042

    Re: Change combobox list based on option button

    Yea, I thought so... I'll have a look and then return you info...

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,042

    Re: Change combobox list based on option button

    Much easier with your approach. Everything working.. Thx.

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,042

    Re: Change combobox list based on option button

    Final file, as I promised... Too large for upload so I have to put it on external site: http://www.2shared.com/file/N1SpWd77/kmlkmzfiles.html

    Everything working now (as I test it but need few more days)... But you'll see codes aren't example of eleganxy (mostly by recording). So any suggestions are wellcome, but not obligatory

    And of course, free for further sharing.

+ 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