"SUM" Based on Description

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
890
Hi all, i would like to "SUM" the below numbers using a VBA code which should base on description in col. "AK". In F.1. are the original data and in Sch.2. is the expected result. Therefore that the rows are not stably and are change due to accounts which have movement for each month.
Thanking you in advance

Sch.1.

<tbody>
[TD="class: xl65, width: 128"]AK[/TD]
[TD="class: xl65, width: 65"]AL[/TD]
[TD="class: xl65, width: 71"]AM[/TD]
[TD="class: xl65, width: 76"]AN[/TD]

[TD="align: right"]546[/TD]
[TD="class: xl66"]TOTAL REVENUE:[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl66, align: right"]-50,555.00[/TD]

[TD="align: right"]547[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl66"][/TD]

[TD="align: right"]548[/TD]
[TD="class: xl65"]COST OF SALES[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]8,150.00[/TD]

[TD="align: right"]549[/TD]
[TD="class: xl65"]ELECTRICIYT[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]3,125.00[/TD]

[TD="align: right"]550[/TD]
[TD="class: xl65"]WATER SUPPLY[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]1,245.00[/TD]

[TD="align: right"]551[/TD]
[TD="class: xl65, colspan: 2"]PRINTING & STATIONERY[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]874.00[/TD]

[TD="align: right"]552[/TD]
[TD="class: xl65, colspan: 2"]HEATING & LIGHTING[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]2,896.00[/TD]

[TD="align: right"]553[/TD]
[TD="class: xl65, colspan: 2"]REPAIRS & MAINTENANCE[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]4,258.00[/TD]

[TD="align: right"]554[/TD]
[TD="class: xl65"]RATES & LICENSES[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]1,368.00[/TD]

[TD="align: right"]555[/TD]
[TD="class: xl65, colspan: 2"]ADMINISTRATION EXPENSES[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]2,562.00[/TD]

</tbody>


Sch.2.

<tbody>
[TD="class: xl65, width: 128"]AK[/TD]
[TD="class: xl65, width: 65"]AL[/TD]
[TD="class: xl65, width: 71"]AM[/TD]
[TD="class: xl65, width: 76"]AN[/TD]

[TD="align: right"]546[/TD]
[TD="class: xl66"]TOTAL REVENUE:[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl66, align: right"]-50,555.00[/TD]

[TD="align: right"]547[/TD]
[TD="class: xl66"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl66"][/TD]

[TD="align: right"]548[/TD]
[TD="class: xl65"]COST OF SALES[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]8,150.00[/TD]

[TD="align: right"]549[/TD]
[TD="class: xl65"]ELECTRICIYT[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]3,125.00[/TD]

[TD="align: right"]550[/TD]
[TD="class: xl65"]WATER SUPPLY[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]1,245.00[/TD]

[TD="align: right"]551[/TD]
[TD="class: xl65, colspan: 2"]PRINTING & STATIONERY[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]874.00[/TD]

[TD="align: right"]552[/TD]
[TD="class: xl65, colspan: 2"]HEATING & LIGHTING[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]2,896.00[/TD]

[TD="align: right"]553[/TD]
[TD="class: xl65, colspan: 2"]REPAIRS & MAINTENANCE[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]4,258.00[/TD]

[TD="align: right"]554[/TD]
[TD="class: xl65"]RATES & LICENSES[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]1,368.00[/TD]

[TD="align: right"]555[/TD]
[TD="class: xl65, colspan: 2"]ADMINISTRATION EXPENSES[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65, align: right"]2,562.00[/TD]

[TD="align: right"]556[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]

[TD="align: right"]557[/TD]
[TD="class: xl66"]TOTAL EXPENSES[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl66, align: right"]24,478.00[/TD]

[TD="align: right"]558[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]

[TD="align: right"]559[/TD]
[TD="class: xl66"]NET PROFIT / LOSS[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl66, align: right"]-26,077.00[/TD]

</tbody>
 
You are welcome.
Glad I was able to help!:)
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top