+ Reply to Thread
Results 1 to 5 of 5

Populate ComboBox from a column excluding duplicates?

  1. #1
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Holland, MI
    MS-Off Ver
    Excel 2007
    Posts
    110

    Populate ComboBox from a column excluding duplicates?

    Hi all,
    I'm looking for some "hopefully" simple code to populate a ComboBox in a Userform from a column in a worksheet and exclude all duplicates. In this case...

    Worksheet = Storage
    Column = AD
    Starting row in AD = 2
    Number of used cells in AD will vary
    trying to populate ComboBox2

    This will happen when the userform is initialized. I tried using some other code I found posted elsewhere and was unable to get it to work. Appreciate the help!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Populate ComboBox from a column excluding duplicates?

    jfoerch,

    Perhaps something like this?
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Holland, MI
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: Populate ComboBox from a column excluding duplicates?

    That worked, but can it be done without sorting the column? The code that I found elsewhere but can't get to work is...


    Please Login or Register  to view this content.
    But, I don't know enough about the language to adapt this to my application. I don't know what the [A1],.[A65536] means and how to make that apply to just AD2 through the used portion of the column. And, I'm not sure if NoDupes is an actual command or a variable that I need to define first.
    Last edited by jfoerch; 05-06-2013 at 01:35 PM.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Populate ComboBox from a column excluding duplicates?

    Yeah, you don't have to sort it. I just put that in thinking it would be nice to have a sorted list. You can just delete that line if you want.

  5. #5
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Holland, MI
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: Populate ComboBox from a column excluding duplicates?

    Perfect. Thanks!

+ 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