Searching for Text In a ComboBox
Posted: Fri Jul 22, 2011 11:53 am
Does anybody know how I can search for a certain text string in a ComboBox. If that text string does not exist then add it to the ComboBox?
Here is the code that I am using, but it does not seem to work!
Sub UpdateComboBox()
For Counter = 0 To ComboBox11.ItemCount
InputString = ComboBox11.Item(Counter)
If InputString = CheckString Then Exit Sub
Next Counter
ComboBox11.AddItem CheckString
End Sub
I am trying to populate a ComboBox with text from a text file. I want to search each line of text in the text file to see if it exists in the ComboBox. If it does not exist, I want to add it to the ComboBox.
Many thanks, in advance!!!!
Darren
Here is the code that I am using, but it does not seem to work!
Sub UpdateComboBox()
For Counter = 0 To ComboBox11.ItemCount
InputString = ComboBox11.Item(Counter)
If InputString = CheckString Then Exit Sub
Next Counter
ComboBox11.AddItem CheckString
End Sub
I am trying to populate a ComboBox with text from a text file. I want to search each line of text in the text file to see if it exists in the ComboBox. If it does not exist, I want to add it to the ComboBox.
Many thanks, in advance!!!!
Darren