+ Reply to Thread
Results 1 to 7 of 7

Macro to concatenate unique combinations??

  1. #1
    Registered User
    Join Date
    09-10-2009
    Location
    Kansas City
    MS-Off Ver
    Excel 2007
    Posts
    2

    Macro to concatenate unique combinations??

    Thanks in advance for any help!

    I have the following example values in Column A and I want to concatenate each unique combination to a list.

    A
    B
    C
    D

    Example necessary output:

    A vs. B
    A vs. C
    A vs. D
    B vs. C
    B vs. D
    C vs. D

    Notice there are no duplicates (e.g., A vs. B / B vs. A). I have found many macros that will create all the duplicates but none that will create only unique. Thanks again!!
    Last edited by oubravs2b; 09-10-2009 at 05:10 PM.

  2. #2
    Forum Contributor
    Join Date
    04-18-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2016
    Posts
    269

    Re: Macro to concatenate unique combinations??

    Hi,

    Use this code:

    Please Login or Register  to view this content.
    I have attached the file for your reference. Be sure to 'Enable Macros'.

    --Karan--
    Attached Files Attached Files

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to concatenate unique combinations??

    How about formulas instead:
    Please Login or Register  to view this content.
    You can use A4:Bn as indices to to do the catenation.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    09-10-2009
    Location
    Kansas City
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Macro to concatenate unique combinations??

    Works like a charm karan! Thanks a TON!!

  5. #5
    Registered User
    Join Date
    04-09-2011
    Location
    Iowa, US
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Macro to concatenate unique combinations??

    Quote Originally Posted by karan View Post
    Hi,

    Use this code:

    Please Login or Register  to view this content.
    I have attached the file for your reference. Be sure to 'Enable Macros'.

    --Karan--
    So how would you change this so you would have a 5 number combo. say you have these numbers 1,2,3,4,5,6

    1,2,3,4,5
    1,3,4,5,6
    1,2,4,5,6
    and so on...

  6. #6
    Registered User
    Join Date
    07-02-2012
    Location
    Nedtherlands
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Macro to concatenate unique combinations??

    Quote Originally Posted by mrroling2000 View Post
    So how would you change this so you would have a 5 number combo. say you have these numbers 1,2,3,4,5,6

    1,2,3,4,5
    1,3,4,5,6
    1,2,4,5,6
    and so on...
    I would also like to know that..;

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to concatenate unique combinations??

    Xaddict,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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