+ Reply to Thread
Results 1 to 5 of 5

Unique Values in Combobox in Userform

  1. #1
    Registered User
    Join Date
    04-08-2015
    Location
    America
    MS-Off Ver
    Office 2013
    Posts
    29

    Unique Values in Combobox in Userform

    I have a userform for users to enter data, which is then populated into the spreadsheet.
    This spreadsheet is effectively a contacts database.
    In column C there is a company name. As a result of having multiple contact for each company, company names are duplicated when I open the userform with a combobox initialised with:

    Please Login or Register  to view this content.
    I would like to somehow alter this code to remove duplicates in column C.

    Any help is appreciated.

    Cheers,

    nKife
    Last edited by nKife; 11-17-2015 at 07:40 PM.

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Unique Values in Combobox in Userform

    Hi nKife,

    Here's one way:

    Please Login or Register  to view this content.
    Regards,

    Robert
    Last edited by Trebor76; 11-16-2015 at 01:04 AM.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Unique Values in Combobox in Userform

    Here's how you'd do it without relying on error handling, it's a good idea to avoid looping through ranges or using .addItem:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-08-2015
    Location
    America
    MS-Off Ver
    Office 2013
    Posts
    29

    Re: Unique Values in Combobox in Userform

    both methods works perfectly thanks guys!

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Unique Values in Combobox in Userform

    You're welcome. Thanks for marking the thread as solved and for the rep

    Regards,

    Robert

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Unique items in combobox on userform
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-16-2015, 09:31 AM
  2. Add only unique values to combobox problem
    By Fredma in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-02-2014, 09:09 AM
  3. [SOLVED] Unique values in a variable Combobox
    By JorisDDS in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-13-2014, 04:33 PM
  4. [SOLVED] Userform combobox to populate RowSource for new values in combobox
    By Stratfordoaks in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-17-2013, 01:18 PM
  5. Userform: Unique Values to ComboBox
    By dinosaur1993 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-21-2013, 03:09 AM
  6. [SOLVED] Changed userform combobox to listbox, unable to get userform to retrieve datasheet values
    By dragonabsurdum in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-29-2013, 01:38 PM
  7. fill combobox with unique values.
    By ali84pk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2011, 06:23 AM

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