+ Reply to Thread
Results 1 to 7 of 7

merging multiple duplicate rows on large files

  1. #1
    Registered User
    Join Date
    11-04-2014
    Location
    washington dc
    MS-Off Ver
    2007
    Posts
    4

    Question merging multiple duplicate rows on large files

    Hello I'm trying to run the script below on the data shown in the "raw" sheet of the attached workbook. When I run it on just the first 5-10 rows, it works just fine as shown in the "intended" sheet. When I try to run it on the full 30,000, I get a "run time error 1004" and this line is flagged in the debugger: Cells(1, "H").Resize(nIndex, 2) = sNames. Can anyone figure out why the script is dying when run on the 30,000 rows? Thanks for any help!


    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: merging multiple duplicate rows on large files

    I have adjusted the code and it will not error, but I am not sure on the out put.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-04-2014
    Location
    washington dc
    MS-Off Ver
    2007
    Posts
    4

    Re: merging multiple duplicate rows on large files

    This is much better, but you are right that the output is a definitely a bit strange. It seems it is munging some of the cell data together rather than keeping each cell a separate entity. Multiple barcodes are being included in the same cell separated by commas.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: merging multiple duplicate rows on large files

    Need to show your desired out as it is not clear on the attached.

  5. #5
    Registered User
    Join Date
    11-04-2014
    Location
    washington dc
    MS-Off Ver
    2007
    Posts
    4

    Re: merging multiple duplicate rows on large files

    Quote Originally Posted by AB33 View Post
    Need to show your desired out as it is not clear on the attached.
    Sure thing. Thanks again for your help. So the data would start out like this:
    Barcode 12345
    Permanent auc
    Temporary auc
    Barcode 12346
    Permanent auz
    Temporary auz
    Barcode 12347
    Permanent aur
    Temporary auc

    And be transformed into this:
    Barcode 12345 12346 12347
    Permanent auc auz aur
    Temporary auc auz auc

    Or even more ideal (I'm just going to transpose it anyway):
    Barcode Permanent Temporary
    12345 auc auc
    12346 auz auz
    12347 aur auc

    I have been able to accomplish this task using a Wend, While script, but the transform takes forever on a set of 30,000. The base script that I included in the xlsm files above works so much faster. I just need the output to display properly.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: merging multiple duplicate rows on large files

    I assumed you wanted the items on a separate columns. It is difficult to see output on text format.
    The output is on column C, so as to see the data, but can easily changed.
    Attached Files Attached Files
    Last edited by AB33; 11-25-2014 at 01:07 PM.

  7. #7
    Registered User
    Join Date
    11-04-2014
    Location
    washington dc
    MS-Off Ver
    2007
    Posts
    4

    Re: merging multiple duplicate rows on large files

    Thanks so much. This is perfect output and perfect script. I really appreciate the help. So much faster and more efficient than what I was using.

+ 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. Merging Duplicate Rows to a column
    By geiollex in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2012, 10:07 PM
  2. Replies: 0
    Last Post: 09-18-2011, 06:48 PM
  3. Merging duplicate rows
    By nlm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2011, 08:41 AM
  4. Excel 2007 : Merging Duplicate Rows
    By bonnie685 in forum Excel General
    Replies: 1
    Last Post: 06-17-2010, 10:07 AM
  5. Removal of Duplicate Rows in Large Files
    By Skoal in forum Excel General
    Replies: 2
    Last Post: 05-04-2005, 06:30 PM

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