Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a Userform that when it is initialized I need to fill an Array or
Collection with 1 to 8 Cell Values. Is there a difference between Array and Collection? Differences other than Array's hold values, Collection holds objects. -- Cheers, Ryan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Collections and Dictionary objects have a key associated with them. You can
directly access an item in the collection (or dictionary) if you know the key. To find a specific item in an array, unless you happen to know the index number you need to traverse the array to find the value. Think of it like worksheets. You can access a worksheet if you know the tab name. You do not need to know the index number. The tab name is the key value for the collection. -- HTH... Jim Thomlinson "RyanH" wrote: I have a Userform that when it is initialized I need to fill an Array or Collection with 1 to 8 Cell Values. Is there a difference between Array and Collection? Differences other than Array's hold values, Collection holds objects. -- Cheers, Ryan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On top of what Jim stated, a Collection object can also be used to
hold a unique list of items (similar to what you can do with Advanced Filter to eliminate duplicates in a list). See http://j-walk.com/ss/Excel/tips/tip47.htm for more info. --JP On Sep 18, 2:14*pm, RyanH wrote: I have a Userform that when it is initialized I need to fill an Array or Collection with 1 to 8 Cell Values. *Is there a difference between Array and Collection? *Differences other than Array's hold values, Collection holds objects. -- Cheers, Ryan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So what did you end up choosing?
--JP On Sep 18, 2:14*pm, RyanH wrote: I have a Userform that when it is initialized I need to fill an Array or Collection with 1 to 8 Cell Values. *Is there a difference between Array and Collection? *Differences other than Array's hold values, Collection holds objects. -- Cheers, Ryan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Collection verses array | Excel Programming | |||
VBA - array or collection literals? | Excel Programming | |||
Collection vs. Array of Arrays, nszim | Excel Programming | |||
VSTO: Sheets collection a 1-based array(?!?!?) | Excel Programming | |||
Writing to An Array or Collection | Excel Programming |