-
I have a collection call colors. I have about 15 color elements in this collection.
When I'm adding colors to the collection is there away to see if one of them already exist. For example lets say element #3 is blue, but at 16 the user wants to add blue again, how could I test to see if its already there
Thanks
-
You can modify this:
Dim sDummy As String
Dim bFound As Boolean
On Error Resume Next
'If the text is in the collection, Err = 0, otherwise it's not
sDummy = MyCollection.Item(Text1.Text)
bFound = (Err = 0)
If bFound Then
Err.Clear
MsgBox "Already in list"
Else
List1.AddItem Text1.Text
MyCollection.Add Text1.Text, Text1.Text
End If