Results 1 to 7 of 7

Nested loops + concatenate values based on match

Threaded View

  1. #1
    Registered User
    Join Date
    07-24-2011
    Location
    Ottawa
    MS-Off Ver
    Excel 2007
    Posts
    91

    Nested loops + concatenate values based on match

    Sorry for the uninforming title.

    My task is quite simple but I need this to be done in a macro (instead of filtering) and it has proven surprisingly difficult for me.

    I have 3 columns (A,B,C) and an open-ended list of items (rows).
    - A (category): gives the item's category (multiple items have the same category)
    - B (value): item's value (text) which may not be unique among items
    - C (selection): takes value TRUE or FALSE

    I would need a macro that would report (separately for each category) the list of values taken by items that have been selected (i.e. for which column C equals TRUE). I would need the output to be a text string looking like this:

    - Name of category 1: value1.1, value1.3, value1.5
    - Name of category 2: value2.3
    - Name of category 3: no item was selected for category 3

    Here is a simplified example of my excel file Template.xlsx.

    Many thanks!

    PS: while the example has 3 different categories, this will vary in practice so the code should be robust to any number of categories ideally.
    Last edited by olivierpbeland; 03-22-2013 at 02:25 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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