+ Reply to Thread
Results 1 to 5 of 5

Combine Duplicate Rows and Sum the Values

  1. #1
    Forum Contributor
    Join Date
    11-21-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    150

    Red face Combine Duplicate Rows and Sum the Values

    The simple down and dirty is that I need to match part numbers to the quantity, copy all results, and paste them on a separate tab.

    One thing that is kind of messing me up is that the program will need to skip blank cells in column A. For example, the table I copy information from to paste on the “Part Count” tab looks like this:

    A B-AG AH
    QTY Irrelevant - ignore these columns Part Number
    1 "" N/A
    1 "" RIB2401B
    1 "" RIB2401B
    1 "" RIBXGTA
    ""
    1 "" QAA2221.FWSN
    2 "" RIB2401B
    2 "" RIB2401B
    ""
    2 "" RIB2401B
    2 "" RIB2401B
    2 "" RIBXGTA

    For this to work, I’m trying to sequence the following 5 steps into my code as follows:

    (1) Look in range A14:A for a number. If there is a number, match the number to cell AH on the same row. If there is no number, skip the cell.
    (2) copy and paste each match on to the “Part Count” tab – column A will be for the quantity and column B for the part numbers.
    (3) Once on the “Part Count” tab, search for duplicates.
    (4) If duplicates are found, add the duplicates together using the quantity in column A.
    (5) Array the part numbers in descending order – highest quantity on top followed in descending order until the lowest value is listed.


    For example, the part numbers tab would now look like this:

    A B
    QTY Part Number
    10 RIB2401B
    3 RIBXGTA
    1 QAA2221.FWSN
    1 N/A

    As a demonstration, I created a spreadsheet to show you exactly what I mean using the above example I listed in this post. If I could get this program to work, it would save hours of time for each project I have to do.

    I know I'm asking a lot. Any help would be appreciated .
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Combine Duplicate Rows and Sum the Values

    Starting with empty Part Count Sheet or could there be already data ?

    Kind regards
    Leo

  3. #3
    Forum Contributor
    Join Date
    11-21-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    150

    Re: Combine Duplicate Rows and Sum the Values

    it would just be a matter of clearing and replacing the data each time.

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Combine Duplicate Rows and Sum the Values

    Here the result go to sheet Result

    Please Login or Register  to view this content.
    Kind regards
    Leo
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    11-21-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    150

    Re: Combine Duplicate Rows and Sum the Values

    Very amazing. My original code looked a lot different and couldn't do half of what you did in that short script. Very impressive. Thank you much!

+ 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. Remove duplicate rows and combine cells with differing values
    By dwadewade in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-29-2017, 10:39 AM
  2. combine duplicate rows
    By asmi in forum Excel General
    Replies: 6
    Last Post: 02-25-2015, 03:15 PM
  3. [SOLVED] Combine rows with duplicate items in one cell and merge values in other cell
    By Niclal in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-18-2014, 07:04 AM
  4. Combine rows with duplicate values into separate columns
    By itgeekgroup in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-18-2014, 11:12 AM
  5. Combine Duplicate Rows and Combine Data in Rows
    By cherylmcgk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2013, 12:04 PM
  6. Replies: 8
    Last Post: 04-12-2012, 08:02 PM
  7. Find and combine duplicate rows
    By treva26 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-09-2007, 09:14 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