Results 1 to 9 of 9

Arrays and Collections and Dictionaries oh my

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Arrays and Collections and Dictionaries oh my

    Hi everyone. I hope you can give me some high-level guidance on something I'm working on. I'm beginning to learn VBA for Excel and have a specific problem I wish to solve (/ dynamic workbook I want to make) in mind. Part of the workbook will involve taking a list of stock tickers, their associated name, sector, and subsector and putting it in a list somewhere else. For example three lines of data are

    AMZN Amazon.com, Inc. Consumer Discretionary Internet & Catalog Retail
    KO Coca-Cola Company Consumer Staples Beverages
    XOM Exxon Mobil Corporation Energy Oil Gas & Consumable Fuels

    There are more than 500 rows like that ^ and they change every once in a while. The first two columns never repeat, while the third and fourth (sector and subsector) repeat often.

    I would like to make lists, for example, of everything in Consumer Discretionary. And separately, everything in Beverages. And separately, everything in Oil Gas & Consumable Fuels. My question is what is the best way to implement this?

    I've been reading a lot about potential different ways to do this and don't know which will make my life hardest/toughest. Considering the data (e.g. the values in each row will always be associated with each other), should I use...
    • A 2D array?
    • A collection?
    • A dictionary?
    • A 1D array with a user-defined type that includes four strings?
    • Something else?

    I can upload a workbook if you want, but I'm not expecting too much code, if any, in an answer. Let me know if you need more information. Thanks

    EDIT: I should clarify that the length and members of all the lists are variable. (Depends on the original list from which everything else is derived...)
    Last edited by JYTS; 12-22-2015 at 03:14 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Creating Dictionary of Dictionaries
    By Dodo123 in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 03-02-2014, 11:30 AM
  2. [SOLVED] Looking for online learning materials on arrays & scripting dictionaries
    By strud in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-11-2013, 08:16 AM
  3. Collections within class module collections
    By AndyLitch in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2013, 06:00 AM
  4. Multiple Dictionaries Or One Dictionary
    By goss in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-15-2012, 07:58 AM
  5. Creating find and replace dictionaries
    By SlipperyPete in forum Excel General
    Replies: 1
    Last Post: 12-15-2006, 11:54 AM
  6. Trouble with Arrays / Collections
    By John in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-07-2005, 03:05 PM
  7. VBA - Collections/Arrays/Sorting
    By William Benson in forum Excel General
    Replies: 5
    Last Post: 05-31-2005, 10:05 AM
  8. [SOLVED] Dictionaries for grouping
    By Piotr in forum Excel General
    Replies: 2
    Last Post: 05-23-2005, 07: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