+ Reply to Thread
Results 1 to 5 of 5

Will a Combo box only display unique entries in the source data?

  1. #1
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Will a Combo box only display unique entries in the source data?

    Hello, I want to create a drop down list from a column of data that is several thousands of rows long, but only contains 5 unique entries. Is it possible to create a combo box, or a data validation list to only display unique entries? Is there some other method that I am not aware of to accomplish this?

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Will a Combo box only display unique entries in the source data?

    Hi,

    You can use a collection which is only able to hold unique items:

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Will a Combo box only display unique entries in the source data?

    Don't tell me you didn't even try to google. There are dozens of related queries out there, I got 93,500 hits on this search: "display unique values only on excel combobox".

    So please look there first and let us know if you have any problems with those issues. Remember, that in this forum, the gurus will feel discouraged to help if they believe you haven't done your part. :;
    Ron
    Knowledge is knowing that a tomato and pepper are fruits. Wisdom is knowing whether to put these in a fruit salad

    Kindly

    [1] Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks
    [2] Mark your post [SOLVED] if it has been answered satisfactorily by editing your original post in advanced mode.
    [3] Thank (using the little scale) those that provided useful help; its nice and its very well appreciated

  4. #4
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Re: Will a Combo box only display unique entries in the source data?

    Actually, I googled this for almost and hour. My problem is my lack of knowledge on how to apply the solutions presented in the 93k hits I found. Having never worked with combo boxes, I am not sure how to set them up.


    Domski, I put your code in a module, changed the cell references to my ranges, and changed the name of the list box to theone I have already created in my sheet (my code is below), but it fails when i try to run the macro to an error stating "object require" on the line below. Did I put your code in the correct location? Any idea why it fails?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Will a Combo box only display unique entries in the source data?

    Can you upload a sample workbook? I'm out tonight but will have a look tomorrow.

    Dom

+ 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