+ Reply to Thread
Results 1 to 6 of 6

Combining Rows With Duplicate Data

  1. #1
    Registered User
    Join Date
    01-26-2010
    Location
    LA
    MS-Off Ver
    Excel 2003
    Posts
    16

    Combining Rows With Duplicate Data

    Hi all! I've searched the nets high and low with no luck, and I'm convinced there must be some easy code for this: I need to combine rows with that have the same column A value into one row. The duplication will be no more than 3 (ie 3 As, 2 Bs, 3 Cs, 1 D etc). I am looking for one of two options. 1) Ideally I'd like to be able to take 2 columns and turn them into up to 4 columns total. 2)Alternately, I can format the data to be in the correct columns to start, but will still need to merge the duplicate rows. The data can have any number of rows to start. I've found something close, but it puts the new column data into ascending number order, which won't work for me because I need it to be in the specific order I input.(It also put all the data into one column, which I don't mind because I can do text to columns, but the order was the bugger.)

    Please see example.
    Thanks for any help you can give!

    BTW, I'm only a little familiar with vba stuff. I can work my way in and plug in code, but I'm not good with manipulating it.
    Attached Files Attached Files
    Last edited by Jaricketts; 01-27-2010 at 11:50 PM. Reason: solved

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Combining Rows With Duplicate Data

    Is there a fixed set of places in column A? I notice some don't have e.g. a "suburban" value.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Combining Rows With Duplicate Data

    Based on the ALTERNATE sheet, run this macro (make sure the sample results at the bottom are removed first so it's a pure data set):
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    01-26-2010
    Location
    LA
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Combining Rows With Duplicate Data

    JBeaucaire -- Thank you, that works great!!


    StephenR -- No, there isn't a fixed set of places. My output program will only list the place in A if there is a value for its B column.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Combining Rows With Duplicate Data

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated. It is found across from the "time" in each of our posts.)

  6. #6
    Registered User
    Join Date
    01-26-2010
    Location
    LA
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Combining Rows With Duplicate Data

    I have a new issue with this one...now my A column is 3 digit zips...and the fix is adding the zips together. Is there a way to modify the macro to be relevant for text or digits? I have a project due in a few hours, so this would help greatly. I have up to 2000 rows to format, and 3 columns(if someone could give me a macro to do 6 columns, that would be even better, but I'm not being picky at this point!)

    Thanks all!!

    I attached a sample to show what the macro is doing to my data.
    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)

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