×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How do I show a list of unique items in a ComboBox?

How do I show a list of unique items in a ComboBox?

How do I show a list of unique items in a ComboBox?

(OP)
My program is in VBA.  I have a ComboBox showing the items from an array, but there are some repeated items and I don't want to show the same item twice or more in any ComboBox.  How can I do it?  How can I make the ComboBox to show each item from the same array just one time and don't show repeated items?  I will appreciate any help.

RE: How do I show a list of unique items in a ComboBox?


I don't know any shortcuts to your problem. You'll just have to do it the hard way; before adding the item, check if it already exists.

You can use the "Like"-operator, "InStr"-function or "StrComp"-function to check for the existance.

Kim

RE: How do I show a list of unique items in a ComboBox?

Before you use the AddItem code put in Combo1.Clear and the
combobox will only show the items that are added

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources