Results 1 to 4 of 4

Struggling to obtain unique items in drop-down boxes

Threaded View

  1. #1
    Registered User
    Join Date
    07-31-2011
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Struggling to obtain unique items in drop-down boxes

    Hello, I am new here and hoping somebody can help me with a problem or two - and these may be the first of many!

    Basically I have 3 drop down lists (combo boxes) on my first worksheet. They are category, sub category and then a selection of options in the 3rd box which are based on the selections of the first two, so these are dynamic drop downs.

    I am using the "Name Manager" to name lists of data that the drop down boxes will reference with the following code:
    Private Sub ComboBox1_Change()
    With ComboBox2
    .Clear
    Select Case ComboBox1.Value
    Case "Option_1"
    .List = Sheets("Data").Range("B81:B150").Value
    Case "Option_2"
    .List = Sheets("Data").Range("B33:B80").Value
    Case "Option_3"
    .List = Sheets("Data").Range("B2:B25").Value
    Case "Option_4"
    .List = Sheets("Data").Range("B26:B32").Value
    End Select
    End With
    End Sub

    Each of the "options" for ComboBox1 are fine, because they will be unique and I can just use a ListFillRange to reference the cells containing this information.

    However, there will be duplicate sub categories because there will be multiple entries under each option but I have no idea how to make these entries unique when using a dynamic drop down? Obviously if I was just using the ListFillRange, I'd be able to remove the duplicates, but if I use this then I can't make the results of ComboBox2 dependent on what's been selected in ComboBox1.

    Another thing is, because I am using the Name Manager, my combo boxes will show the name of the list, because this has to match up. So because I can't use spaces in the Name Manager, I have to name them Option_1, Option_2, etc. and it looks really untidy. Is there a better way of doing dynamic combo boxes so that I can avoid this?

    Please bear in mind I am an Excel novice so the above might not make much sense, and if there's any thing I've missed then just let me know, but I'd be so so grateful if somebody could offer some advice on these issues.

    Many thanks,
    Last edited by Leith Ross; 07-31-2011 at 03:45 PM. Reason: Added Code Tags

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