Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Todd,
Here is a function to test it Public Function IfExists(col As Collection, ByVal sKey As String) On Error GoTo NoSuchKey If VarType(col.Item(sKey)) = vbObject Then ' force an error condition if key does not exist End If IfExists = True Exit Function NoSuchKey: IfExists = False End Function -- HTH RP (remove nothere from the email address if mailing direct) "Todd Huttenstine" wrote in message ... Hey How do you test to see if a particular value is in a collection object? For example, I have a collection with 5 items in it. The items in it a "abc", "def", "ghi", "jkl", and "mno". How can I test to see if the value "jkl" is in this collection, and return true or false? Thanks Todd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
help with data collection! | New Users to Excel | |||
Does anybody have a CD collection template | Excel Discussion (Misc queries) | |||
Reset New Collection | Excel Programming | |||
2 Collection questions | Excel Programming | |||
Names Collection | Excel Programming |