+ Reply to Thread
Results 1 to 9 of 9

Macro to concatenate data on cells with matching value in A

  1. #1
    Registered User
    Join Date
    08-17-2010
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    8

    Macro to concatenate data on cells with matching value in A

    I have a spreadsheet with data laid out as follows:

    Please Login or Register  to view this content.
    I want to concatenate the date so that all the rows with the same value in A are lined up, like so:

    Please Login or Register  to view this content.
    Can anyone help?
    Last edited by s00shi; 01-20-2014 at 05:56 AM. Reason: adding "code"

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Macro to concatenate data on cells with matching value in A

    Post a workbook with a sheet before and a sheet after making the change. Had you posted the snippet between quote tags, I might have been able to see what you want.

  3. #3
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: Macro to concatenate data on cells with matching value in A

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-17-2010
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to concatenate data on cells with matching value in A

    Hi,

    Thanks for that. I can't see how to insert a workbook, but I've added the code tags, and made some screenshots, does that help?

    Before:
    before.jpg

    After:
    after.jpg
    Attached Images Attached Images
    Last edited by s00shi; 01-20-2014 at 06:14 AM. Reason: pictures not uploaded

  5. #5
    Registered User
    Join Date
    08-17-2010
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to concatenate data on cells with matching value in A

    Hi!

    Thanks for this. I've created a macro, but when I run it, I get the following error message:

    "Run-time error '13':

    Type mismatch"

    When I click Debug, the following line is highlighted:

    .Resize(, 2).Value = WorksheetFunction.Transpose(Array(Dict.keys, Dict.items))

    Should I have amended it in some way?

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to concatenate data on cells with matching value in A

    Maybe:

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: Macro to concatenate data on cells with matching value in A

    do you have that problem with the cells above or with other data ?
    It can cause problems if the string of collected words for 1 entry is longer then 255. Is that the case ?
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-17-2010
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to concatenate data on cells with matching value in A

    This has done it.

    Thanks everyone for your help!

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to concatenate data on cells with matching value in A

    If you've got a working solution, please comply with Forum Rule No 9.


    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

+ 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. Concatenate data in 3 columns for each row matching the full name
    By mcain1981 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-08-2013, 06:49 PM
  2. Concatenate multiple cell values based on matching adjacent cells
    By mkrzy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2013, 02:40 AM
  3. Concatenate cells with rows matching certain conditions ?
    By btc5 in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 03-30-2013, 09:58 AM
  4. Help with merge duplicates rows and concatenate non matching data
    By johnboy82 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2012, 05:23 PM
  5. 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

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