OK, I have a simple problem that I need help with in a VBA Macro. I have an excel sheet that looks like this…
Product # Count
101 1
102 1
101 2
102 2
107 7
101 4
101 4
189 9
I need a macro that adds up the “count” column based on the Product Number Column. I want it to over all look like this after I am done…
Product # Count
101 7
102 7
107 7
189 9
I am an amiture to VBA so I would love any help I can get.
Assuming the data is in columns A and B, you can do it with a formula:
Or if you put 101 in C1:
EDIT
However if you still require VBA, here is my (quick and dirty) proposal – I use a dictionary to keep track of the sum for each item.