PDA

View Full Version : Combining duplicates based on several conditions



Robert87
11-19-2014, 06:45 AM
I have a list that looks something like this:

Type Length Amount

A 300 1
A 300 2
A 600 1
B 500 1
B 500 4
B 500 2


I need a VBA code to combine thoose rows when both Type and Lenght match. So that list should look like this:


Type Length Amount

A 300 3
A 600 1
B 500 7

I would love to get some help with this.

ranman256
11-19-2014, 10:56 AM
Make a query that sums on the AMT.

Robert87
11-19-2014, 12:44 PM
How would I do that?

I´m a bit of a newbie in the whole VBA area.

Edit:

The numbers and data I´m using needs to be able to be changed very easily.