+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : Macro to sum and merge like cells

  1. #1
    Registered User
    Join Date
    12-27-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    8

    Macro to sum and merge like cells

    I would like to run a macro that will take a set of data and merge like cells in specific columns, add other specific columns, if a number of cells match in a row. Here is my example. I want to have the macro search for rows that have matching "date" fields, matching "product" fields and matching "color" fields...and then have the macro merge those rows in to one row while summing up the "hours open" field and "total sold" field.And then display it chronologically.

    I am brand new to the excel/vba world. Below is a visual example. I appreciate any and all help. Thanks.



    What it looks like before:

    Date total sold product color hours open
    12/22/2011 10 1 2 5
    12/23/2011 2 2 2 4
    12/23/2011 5 2 2 3
    12/22/2011 7 1 2 5
    12/22/2011 6 2 1 8
    12/22/2011 4 1 2 6
    12/22/2011 8 1 1 4
    12/23/2011 11 2 2 3
    12/23/2011 2 1 2 4

    What it should look like after :

    Date total sold product color hours open
    12/22/2011 8 1 1 4
    12/22/2011 21 1 2 16
    12/22/2011 6 2 1 8
    12/23/2011 2 1 2 4
    12/23/2011 18 2 2 10

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro to sum and merge like cells

    Hi mauricio1013 and welcome to the forum,

    I think you are wanting a Pivot Table that is grouped by Date, Product and Color and then total the sold and hours. Start here http://office.microsoft.com/en-us/ex...010205886.aspx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    12-27-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Macro to sum and merge like cells

    That def helped. Any idea on how I can order the dates chronologically?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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