+ Reply to Thread
Results 1 to 8 of 8

Macro to concatenate cells adjacent to duplicates

  1. #1
    Registered User
    Join Date
    10-15-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Macro to concatenate cells adjacent to duplicates

    Sample.xlsxI should prefix this post by acknowledging that I have viewed the other topics with this theme. Mine is slightly unique although I'll put a link to these older topics for your convenience. Below I have what I would like my table to display. In the first too columns we have two ID's. Ideally what I would like to do is concatinate the ID's of (ID2) in the concatID if they share duplicate (ID1) values Without deleting any rows. Therefore the ConcatID column will contain multiple repeated concatinated values due too there being numerous ID2's sharing duplicate ID1's.
    _______ ID1 _________ ID2 _______________ CONCATID
    111001-0401. 111001-0401 . 111001-0401, 121001-0401
    111001-0401 .121001-0401 . 111001-0401, 121001-0401
    121001-0402. 121001-0402 . 121001-0402
    121001-0403. 121001-0403 . 121001-0403

    In other words I want to do this: http://www.excelforum.com/excel-prog...uplicates.html
    but without deleting any rows. So in contrast I want to concatenate values based on ID(1) but have this concatenation occur identically in each row where they might be any duplicates.

    Too do so I know I have to create a VBA code like this: except without the deleting the rows part.
    (All credit for the code from JBeaucaire) Here is another forum post doing what I want to do exept the part about deleting the rows http://www.excelforum.com/excel-prog...nd-delete.html
    Please Login or Register  to view this content.
    Hopefully this post wasn't too confusing. Let me know if I can be of assistance. I'm new here so I would appreciate any help you can offer.
    Thanks so much!
    (edit) Provided attachment as my table format was messed up.
    Last edited by tkellymc; 10-16-2013 at 12:00 PM. Reason: Attachment

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

    Re: Macro to concatenate cells adjacent to duplicates

    try
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-15-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro to concatenate cells adjacent to duplicates

    Thanks so much. That was brilliant. If i was to change to forumula to relate to column S T and U would I just change all the A values too s?

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

    Re: Macro to concatenate cells adjacent to duplicates

    Need to see actual data layouts.

    That's a most important part.

  5. #5
    Registered User
    Join Date
    10-15-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro to concatenate cells adjacent to duplicates

    Sample3.xlsxI've blanked out the rest of the cells because they dont affect the data in question.
    Data contained without the 10.8kb one. Sorry for the duplicate
    Attached Files Attached Files

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

    Re: Macro to concatenate cells adjacent to duplicates

    OK.
    change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-15-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro to concatenate cells adjacent to duplicates

    Thanks Sir. You are an excel wizard. And Exizard!

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

    Re: Macro to concatenate cells adjacent to duplicates

    You are welcome and thanks for the feed back.

    Can you mark this thread as "Solved"?

+ 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. Macro to find duplicates, concatenate cells, then delete old duplicates
    By givemepuppies in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-04-2016, 02:43 AM
  2. [SOLVED] Macro to concatenate cells adjacent to duplicates
    By 084851 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2013, 09:18 AM
  3. Concatenate VBA Macro that excludes duplicates and zeros... 30+ cells of data
    By supernovanexus in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-20-2012, 01:23 AM
  4. Replies: 4
    Last Post: 01-05-2011, 11:37 PM
  5. Concatenate non-adjacent cells without duplicates
    By turningitred in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-18-2009, 11:08 AM

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