Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Array vs. Collection

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Array vs. Collection

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Array vs. Collection

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Array vs. Collection

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection verses array Curt Excel Programming 4 October 8th 07 11:17 PM
VBA - array or collection literals? Marcus Schöneborn Excel Programming 2 September 21st 07 08:52 PM
Collection vs. Array of Arrays, nszim Neal Zimm[_2_] Excel Programming 13 February 6th 06 02:36 PM
VSTO: Sheets collection a 1-based array(?!?!?) Bob Sullentrup Excel Programming 0 November 10th 05 04:10 PM
Writing to An Array or Collection vqthomf Excel Programming 4 August 23rd 05 02:07 PM


All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"