Mark Green
Board Regular
- Joined
- Apr 15, 2016
- Messages
- 125
I wonder if someone can help me with some VBA code to get totals?
I will be able to write code to sort the columns according to column B (Description).
I would like to first insert a row at the end of each Col B category.
Then have the totals of all Col C (debit) and D (credit) calculated for each category.
Finally I'd like to take these totals and have them summarized in another part of the sheet.
So it looks something like this now:
Would like totals to appear for each category and also in another place like:
Any help would be appreciated!
I will be able to write code to sort the columns according to column B (Description).
I would like to first insert a row at the end of each Col B category.
Then have the totals of all Col C (debit) and D (credit) calculated for each category.
Finally I'd like to take these totals and have them summarized in another part of the sheet.
So it looks something like this now:
Code:
[TABLE="width: 531"]
<tbody>[TR]
[TD="align: right"]9/19/2017[/TD]
[TD]TRIANGLE SEWING[/TD]
[TD="align: right"]5.85[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]10/2/2017[/TD]
[TD]TRIANGLE SEWING[/TD]
[TD="align: right"]7.16[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]10/16/2017[/TD]
[TD]TRIANGLE SEWING[/TD]
[TD="align: right"]6.77[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]11/1/2017[/TD]
[TD]TRIANGLE SEWING[/TD]
[TD="align: right"]17.50[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/3/2017[/TD]
[TD]UBER *US 8.05_V[/TD]
[TD="align: right"]11.15[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/3/2017[/TD]
[TD]UBER *US 9.78_V[/TD]
[TD="align: right"]13.54[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/3/2017[/TD]
[TD]UBER *US 13.14_V[/TD]
[TD="align: right"]18.19[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/3/2017[/TD]
[TD]UBER *US 17.02_V[/TD]
[TD="align: right"]23.58[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/3/2017[/TD]
[TD]UBER *US 21.87_V[/TD]
[TD="align: right"]30.29[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2/3/2017[/TD]
[TD]UBER DO FE 185.82_V[/TD]
[TD="align: right"]5.35[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2/6/2017[/TD]
[TD]UBER DO FE 185.82_V[/TD]
[TD][/TD]
[TD="align: right"]5.06[/TD]
[/TR]
[TR]
[TD="align: right"]4/20/2017[/TD]
[TD]UNION GAS H7K3R3[/TD]
[TD="align: right"]138.67[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]3/20/2017[/TD]
[TD]UNION GAS K3R9J5[/TD]
[TD="align: right"]150.90[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2/21/2017[/TD]
[TD]UNION GAS K4X3W6[/TD]
[TD="align: right"]157.96[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]9/18/2017[/TD]
[TD]UNION GAS Q3Z6H4[/TD]
[TD="align: right"]32.45[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6/14/2017[/TD]
[TD]UNION GAS R3U5L3[/TD]
[TD="align: right"]72.70[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/16/2017[/TD]
[TD]UNION GAS W8R2H3[/TD]
[TD="align: right"]116.03[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]5/16/2017[/TD]
[TD]UNION GAS W8W5H4[/TD]
[TD="align: right"]109.81[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]8/11/2017[/TD]
[TD]UNION GAS X4R5A8[/TD]
[TD="align: right"]36.29[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]7/17/2017[/TD]
[TD]UNION GAS Z4H5W7[/TD]
[TD="align: right"]38.86[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/3/2017[/TD]
[TD]UNIVERSAL 10.64_V[/TD]
[TD="align: right"]14.74[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1/3/2017[/TD]
[TD]UNIVERSAL 34.07_V[/TD]
[TD="align: right"]47.18[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Would like totals to appear for each category and also in another place like:
Code:
[TABLE="width: 256"]
<tbody>[TR]
[TD="colspan: 2"]TRIANGLE SEWING[/TD]
[TD="align: right"]85.02[/TD]
[TD="align: right"]13.55[/TD]
[/TR]
[TR]
[TD]UBER[/TD]
[TD][/TD]
[TD="align: right"]102.10[/TD]
[TD="align: right"]5.06[/TD]
[/TR]
[TR]
[TD="colspan: 2"]UNION GAS[/TD]
[TD="align: right"]853.67[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]UNIVERSAL[/TD]
[TD="align: right"]61.92[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]