+ Reply to Thread
Results 1 to 6 of 6

Dependent Combobox in Excel Userform

  1. #1
    Registered User
    Join Date
    12-06-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Dependent Combobox in Excel Userform

    Hi,
    I am very new to excel VBA programming, and I am trying to create userform with Comboboxes.
    Here is what I have so far,

    userform named (EXPENSE)
    Combobox1 (CboECategory)
    Combobox2 (CBoESubCategory)
    Commandbutton 1 (CmdSave)
    Commandbutton 2 (CmdClose)

    I also have Named Lists for "Exp_Category_List" and "Exp_Subcategory_List" in Sheet named LookupLists

    Below is the code to populate the comboboxes:

    Please Login or Register  to view this content.
    I can get the "CboECategory" combobox to populate with the given list. But I cannot get the "CboESubcategory" combobox to populate depending upon the value in first combobox. As seen above, the commented code I used doesn't list the required values.
    Any help would be greatly appreciated.

    Thanks
    2Deep
    Last edited by 2Deep; 12-07-2010 at 07:08 PM. Reason: code tags required please read the forum rules

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Dependent Combobox in Excel Userform

    You have not supplied a sample workbook.
    You need to populate the 2nd combobox when you change to 1st combobox
    Check out this thread for an example

    http://www.excelforum.com/excel-prog...x-vb-help.html

  3. #3
    Registered User
    Join Date
    12-06-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Dependent Combobox in Excel Userform

    thanks davesexcel,

    attached is my sample workbook. I tried your sample. Its working, but have little problem. When I select category "CASH/CREDIT ACCOUNT" it lists correct sub-categories..... but if i change and select different category for eg. "DAILY HOUSEHOLD" it does not update the list.

    In a sense the sub-categories are not refreshed when i select different categories. How do i get around it. Thanks again for your reply.

    2Deep
    Attached Files Attached Files

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Dependent Combobox in Excel Userform

    Try This
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-06-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Dependent Combobox in Excel Userform

    its working thanks a lot man.... how do i save this thread as solved ..

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Dependent Combobox in Excel Userform

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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