+ Reply to Thread
Results 1 to 5 of 5

Populating combo box using option buttons

  1. #1
    Registered User
    Join Date
    09-08-2013
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Populating combo box using option buttons

    I have two worksheets. One named TelDir which contains a telephone list data with four named ranges which are CIV, JTR and OHL the ranges being arrays of columns A to D.

    On a userform I have three optionbuttons also labelled Civils, Jointers and Linesmen. Finally I have a combobox named cbxTeam.

    I would like to populate the combobox using the option buttons so that when I select Civils, the Data listed in the first column (A) of sheet TelDir is listed in the combobox. Likewise when I select either of the other two categories I would like to display the other two categories of Teams in this same combobox.
    Currently I can display all of the data from the four columns in this combo box but I only want to display the names (column A) of the team members.

    The code I have is as follows.
    Please Login or Register  to view this content.
    Any ideas? I am new to this VBA malarky and am currently getting by using code from other forums and users so if there is a more efficient way of doing this, I'm all eyes

    Many thanks in advance.
    Last edited by Leith Ross; 09-23-2013 at 04:37 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Populating combo box using option buttons

    Please Login or Register  to view this content.
    You would need to do one for the second and third optionbutton. I assumed on some of the names.

  3. #3
    Registered User
    Join Date
    09-08-2013
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Populating combo box using option buttons

    Work perfectly. Thanks for that.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Populating combo box using option buttons

    Alan

    Instead of 3 option buttons why not use a combobox for Civils, Jointers and Linesmen?

    Then you would only need one sub to populate the other combobox.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    09-08-2013
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Populating combo box using option buttons

    That's not a bad idea but other engineers will be using this and I know that they would find it easier to click in a box rather than select from a list.

    If I make the form too complicated, they simply won't use it.

    Thanks anyway.

+ 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. enable certain combo buttons based on user selected option buttons
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-20-2013, 06:43 AM
  2. How can I insert multiple sets of option buttons (radio buttons) in Excel 2010?
    By mickwooduclan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2013, 10:01 AM
  3. [SOLVED] Disabling an Entire Frame with Option Buttons if other Option Buttons are not clicked.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-20-2012, 04:07 AM
  4. Combo box and option buttons
    By mike0123m in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-15-2011, 05:43 AM
  5. Option Buttons and Combo Box Help
    By Mr.G. in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-03-2009, 02:54 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