I have this excel file in Sheet1:
A B C D
Brand Model Type No_of_unit_sold
A AB123 1 1
A AB124 1 2
A AB125 1 11
A AB113 1 21
A AB127 1 42
A AB128 1 12
B BB123 1 21
B BB121 1 32
AB BB122 2 21
AB BB124 1 79
AB BB125 2 61
AB BB126 1 181
B BB127 1 28
B BB128 1 132
C CB121 1 91
C CB122 1 73
C CB123 1 63
C CB124 1 52
C CB125 1 85
A AB129 2 12
C CB126 1 13
C CB128 1 94
C CB129 1 121
I need the VBA to first scan column "Type" for type 1 only.
and then, to look for brand, copy brand A's name, sum up the number of unit sold and paste it in Sheet2:
A B C D E
Brand A B AB C
No_of_unit_sold 89 213 260 592
To sum up the value, I can use sumif function with double criteria. But how do I vary the name of the brand? It's not like using for loop with integer like what I can do for "Type" column...
Also, how do I copy brand name from sheet1 to sheet2 without duplication? Do I use application.worksheetfunction.match? Eg. if the brand name is not found in cells(1,i) of sheet2 then please copy from sheet1 to sheet2?