I need a macro to subtotal a set of rows with duplicate elements in a column, in the example illustrated below it is "Code" and the same need to be pasted in a new workbook or new sheet.
Code Name Debit Credit
1000 ABC Account 100
1000 ABC Account 100
2000 DEF Account 200
2000 DEF Account 150
3000 XYZ Account 200
3000 XYZ Account 200
3000 XYZ Account 100
4000 CCC Account 50
The result should be like this.
Code Name Debit Credit
1000 ABC Account 100 100
2000 DEF Account 350 0
3000 XYZ Account 100 400
4000 CCC Account 0 50
Code Name Debit Credit
1000 ABC Account 100
1000 ABC Account 100
2000 DEF Account 200
2000 DEF Account 150
3000 XYZ Account 200
3000 XYZ Account 200
3000 XYZ Account 100
4000 CCC Account 50
The result should be like this.
Code Name Debit Credit
1000 ABC Account 100 100
2000 DEF Account 350 0
3000 XYZ Account 100 400
4000 CCC Account 0 50