+ Reply to Thread
Results 1 to 3 of 3

Collection item retrieval

  1. #1
    Registered User
    Join Date
    08-27-2014
    Location
    Albany, NY
    MS-Off Ver
    Office 2010
    Posts
    91

    Collection item retrieval

    I have an issue where I have multiple collections. AS in the sample code I just whipped up in this browser, untested(don't flame me for it), I created two collections tempCollection(1) and tempCollection(2). How so I work with these two collections having the same name? Is it "msgbox (tempCollection(1).item(1))" to get a printout of "Apple" and "msgbox (tempCollection(2).item(1))" to get a printout of "New York"?

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Collection item retrieval

    Hello Coleman34,

    You need to create an array of Collection objects. Do this in the Dim statemnt.

    Here is the working and corrected code...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    08-27-2014
    Location
    Albany, NY
    MS-Off Ver
    Office 2010
    Posts
    91

    Re: Collection item retrieval

    Thank you! I was beating this around all weekend. This should work for me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Removing item from collection without its index
    By Galven in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2014, 06:41 AM
  2. Referencing Elements within an Item in a Collection
    By anthony.mcgovern in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2012, 01:34 PM
  3. Reference to Item in Collection
    By Chad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2006, 10:40 AM
  4. Cannot remove item from collection
    By Kou Vang in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2006, 04:25 PM
  5. Check for an item in a collection (without looping)
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2005, 08:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1