PDA

View Full Version : Combine muliple rows into one row based on criteria



smb2004
11-08-2007, 03:45 PM
Hello,

I am trying to cycle though 0-200 rows of data each with a product key and demand data. I need an output of one row for each key with a total of the demand data.

Example:

A spreadsheet like this one:

product demand 1 demand 2 ...
-----------------------------------------------
1616 50 50
1616 50 50
1617 25 25
1616 100 100
1617 50 50

total 275 275


become one like this one:

product demand 1 demand 2 ...
-----------------------------------------------
1616 200 200
1617 75 75

total 275 275



the use of a VBA macro is preferred because I already have one doing other things to get the data, so I can just incorporate it into the current one.

I have a decent grasp of VBA and good knowledge of excel.

Any ideas on how to go about this? THANKS!

XLGibbs
11-08-2007, 04:55 PM
No VBA needed, try a pivot table.