Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
There is nothing like union, intersection, in, not in or any set properties for collections. To test if something is in a collection you must 1. Make sure each element has a unique key when you add it 2. To test if a particular key is in the collection do Err.Clear On error resume next myCollection.Add Item, ItemKey If err.number<0 then msgbox "Sorry, item " & ItemKey & " is in the collection" end if on error goto 0 Unfortunately, this adds the testing item to the collection, so you must be sure it is the same as the original item with that key. If not, you will need two collections - a real one and a testing one! Does anyone out there have a custom Collection Class which has set like properties? regards Paul J Streger wrote: I was told that you can use the 'in' command to see if a particular element exists in a collection, but cannot figure out how to do it, and now I'm skeptical it exists as a function. They described it as: if strElement in colNames then ... but this generates a syntax error, and help has no topics i can find. Can anyone shed light on this? Also does a collection have a function like Join? Thanks. -- ********************* J Streger MS Office Master 2000 ed. MS Project White Belt 2003 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
series objects; finding specific ones in the collection | Charts and Charting in Excel | |||
Finding all elements in a database | Excel Discussion (Misc queries) | |||
Finding elements in a collection | Excel Programming | |||
Finding duplicated elements in a list | Excel Discussion (Misc queries) | |||
Finding the elements of the sum | Excel Programming |