+ Reply to Thread
Results 1 to 8 of 8

Multiple Dictionaries Or One Dictionary

  1. #1
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Multiple Dictionaries Or One Dictionary

    Hi all,

    Using Excel 2007.

    I have 4 lists Parts, Category, Country, Class
    I need to load a string, split the substring into array, loop the array to search dictionary(ies) to assign each element to the correct array.

    What would be best approach in term of the dictionary(ies)

    Thx
    w
    Kind regards,
    w

    http://dataprose.org

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Multiple Dictionaries Or One Dictionary

    Would be better to upload a wb and to show your expected results.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: Multiple Dictionaries Or One Dictionary

    Thanks Mike,

    Can I add a dictionary to an array
    I'm getting a subscript out of range error
    Seem like the code should work

    Thanks
    w

    Please Login or Register  to view this content.
    Last edited by goss; 12-14-2012 at 03:22 PM. Reason: typo

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Multiple Dictionaries Or One Dictionary

    Give this a try

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Multiple Dictionaries Or One Dictionary

    See here for reference.

    Dictionary on Dictionary.

  6. #6
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: Multiple Dictionaries Or One Dictionary

    Thanks Mike,

    That does not appear to add multiple dictionaries, which is fine - except, how do I know the class of an item if I do not know which dictionary it cam from?
    My thought was
    • Grab element from array avItem(j,i)
      Search dic(1) if found then item is in Class Country
      Assign to avCountry()
      Else search dic(2)
      If found then item is in class Customer
      Assign to avCustomer()
      Else search dic(3)
      If found then item is in class Part
      Assign to avPart()
      Else search dic(4)
      If found then item is in class Date
      Assign to avDate()
      Else
      Not found print avItem(j,i) #FileNum

    Is that doable?
    Is there a better way?
    thx
    w

  7. #7
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: Multiple Dictionaries Or One Dictionary

    Thanks Jindon,

    It will take me some time to digest your code.
    I've used VBA for awhile, I've never used the dictionary object.

    thx
    w

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Multiple Dictionaries Or One Dictionary

    Give you the idea.
    Please Login or Register  to view this content.
    So, Main dictionary holds worksheet.names and each item holds its own Dictionary.
    Last edited by jindon; 12-15-2012 at 08:00 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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