Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is the proper syntax for the collection statements in the
following pseudo code: Dim C as Collection Loop over cells in a range: C = New Collection [or is it Set C =.....] LoadC ( C , cell from Loop)[will add item to collection] UseC (C) [will use or do something with the collection] C = Nothing [is this proper, all examples use a Remove] Next Loop over cells Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim colTest As Collection
Dim i As Long Set colTest = New Collection For i = 1 To 10 colTest.Add "Key" & i, "Item" & i Debug.Print colTest.Item(i) Next i Set colTest = Nothing -- HTH Bob Phillips "dick" wrote in message oups.com... What is the proper syntax for the collection statements in the following pseudo code: Dim C as Collection Loop over cells in a range: C = New Collection [or is it Set C =.....] LoadC ( C , cell from Loop)[will add item to collection] UseC (C) [will use or do something with the collection] C = Nothing [is this proper, all examples use a Remove] Next Loop over cells Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
THANKS!!
|
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Although Bob's code will work as written, it is confusing in that
he has the order of Key and Item reversed. Item is the first argument, Key is the second (optional) argument in the Add method. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Bob Phillips" wrote in message ... Dim colTest As Collection Dim i As Long Set colTest = New Collection For i = 1 To 10 colTest.Add "Key" & i, "Item" & i Debug.Print colTest.Item(i) Next i Set colTest = Nothing -- HTH Bob Phillips "dick" wrote in message oups.com... What is the proper syntax for the collection statements in the following pseudo code: Dim C as Collection Loop over cells in a range: C = New Collection [or is it Set C =.....] LoadC ( C , cell from Loop)[will add item to collection] UseC (C) [will use or do something with the collection] C = Nothing [is this proper, all examples use a Remove] Next Loop over cells Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sumproduct usage? | Excel Worksheet Functions | |||
SUMPRODUCT usage | Excel Worksheet Functions | |||
100% cpu usage | Excel Discussion (Misc queries) | |||
SQL - TOP 1 Usage | Excel Programming | |||
Correct Syntax - Collection Key | Excel Programming |