+ Reply to Thread
Results 1 to 4 of 4

Add RowSource to Userform ComboBox based on value on Another ComboBox

  1. #1
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Add RowSource to Userform ComboBox based on value on Another ComboBox

    Hi,

    Exactly as it says in the title. Can I add the RowSource of a ComboBox based on the Value of another ComboBox.

    Example

    Please Login or Register  to view this content.
    This doesn't work but does anyone have any idea what might.

    Thanks in Advance
    Last edited by Baziwan; 10-10-2012 at 01:17 PM.
    Kind Regards

    Baz

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Add RowSource to Userform ComboBox based on value on Another ComboBox

    Hello
    Not sure why your code isn't working. How are you initializing it? The following code works for me on the CombBox1 Change Event:

    Please Login or Register  to view this content.
    Hope this helps.
    DBY

  3. #3
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Add RowSource to Userform ComboBox based on value on Another ComboBox

    Hi,

    I just realised why my code wasn't working. The values I had in ComboBox1 contained spaces and of course the RowSource can't have spaces to work as they're named ranges. Doh!!
    I Do have a related query tho. I'm unable to enter text in ComboBox2. ComboBox1 I can enter a few letters and it autofills to the nearest match in the RowSource but with the above code I'm unable to enter text in ComboBox2. Any ideas why?

  4. #4
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Add RowSource to Userform ComboBox based on value on Another ComboBox

    Never mind that query. I'd shifted the code into combobox2 when I was playing with it. As soon as I placed it back into combobox1 change event it solved the not being able to type issue.

+ 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