+ Reply to Thread
Results 1 to 5 of 5

Multiple groups

Hybrid View

Sora Multiple groups 05-17-2017, 02:53 PM
Arkadi Re: Multiple groups 05-17-2017, 03:06 PM
Sora Re: Multiple groups 05-18-2017, 03:02 PM
Arkadi Re: Multiple groups 05-18-2017, 04:12 PM
Sora Re: Multiple groups 05-19-2017, 10:33 AM
  1. #1
    Registered User
    Join Date
    05-17-2017
    Location
    JERUSALEM, ISRAEL
    MS-Off Ver
    2013
    Posts
    3

    Multiple groups

    Hello everybody!

    First let me tell you some background information. I have two columns of data in a worksheet which I need to sort of group together. I have been using Dictionary object and Union range so I can have multiple items under one key. This worked wonderfully until I came across a problem where I need to add a new item (which is not in any cell) to one key and I would very much like to keep it that way.

    I have no idea what I could do. I've been thinking about using Collections under Dictionary keys but the problem is that I don't know how many collections there will be beforehand.

    Is there anyone around reading this Forum who might know of a way to accomplish this in some manner?

    At least tell me if this is completely impossible, please...

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Multiple groups

    Although I get the general idea, it is hard to visualize what exactly you need... however, you could look into nested dictionaries to see if this helps?
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    05-17-2017
    Location
    JERUSALEM, ISRAEL
    MS-Off Ver
    2013
    Posts
    3

    Re: Multiple groups

    Let me give you a simple example of what I'm doing (not in reality). We've got names in one column and some values in another. There might be some duplicate names in there so I've used names as keys and the values are in a Union "under" those keys. I hope this helps in visualizing.

    As the original post stated, I need to add a value, that is only in the module, to one or more of those keys. I would rather not go into details as to why, but that's just how it is.

    I Have looked in to nested dictionaries before and I don't believe that is going to cut it, I might be wrong though.

    If you still think that works, could you please try and explain your idea?

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Multiple groups

    I don't know how you are using the data, but could you not just use a delimiter between values, and if a name is already a key in the dictionary, just append the new value? you could then, when using the data, use the split function to create an array of the values for that name, and work with that?
    I realize the data is probably sensitive, but if you could provide a workbook with some sample data illustrating the scenario and how the data is used (perhaps the macro that this pertains to), that would make it easier to come up with a suitable solution?

    For example, if "John" already exists in the dictionary with a value ABC, and there is another instance of John with DEF, you could append a character that is not in the data, lets say ^ for argument's sake... so that the new value for the key John, would be ABC^DEF. Later when using the values, just break up the value for the key using Split(value for john,"^")
    Last edited by Arkadi; 05-18-2017 at 04:14 PM.

  5. #5
    Registered User
    Join Date
    05-17-2017
    Location
    JERUSALEM, ISRAEL
    MS-Off Ver
    2013
    Posts
    3

    Re: Multiple groups

    I hadn't thought of that. I think that actually works. Thanks for the suggestion.

    The items actually contain numbers and I need to put them in order.

    I made this using the delimiter idea. If you get any more ideas after checking that out, I would be glad to hear them.
    Attached Files Attached Files

+ 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. Replies: 26
    Last Post: 01-15-2016, 03:38 AM
  2. How to group multiple groups
    By ammartino44 in forum Excel General
    Replies: 1
    Last Post: 05-06-2014, 02:48 PM
  3. Replies: 5
    Last Post: 02-13-2013, 05:00 PM
  4. Groupin multiple rows into multiple groups
    By Coin in forum Excel General
    Replies: 4
    Last Post: 11-29-2012, 10:37 AM
  5. Multiple Averages by Groups
    By icytea_thunder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-28-2009, 05:45 AM
  6. Excel 2007 : Multiple Freeze Groups
    By Matlock790 in forum Excel General
    Replies: 0
    Last Post: 03-24-2009, 12:39 AM
  7. Multiple groups in X axis
    By westis in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 01-18-2007, 04:57 PM

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