Sum Total Transactions Each Month VBA

rpichler

New Member
Joined
Apr 10, 2014
Messages
1
Hello everyone, this is my first time posting in the forum, but I have found many answers on here from others' questions and they are very helpful! So my problem is I have a budgeting spreadsheet which I am working on. I have the date which each transaction was made, a column to state whether it is a deposit or an expense, and then the corresponding value. What I want to do is have VBA search through the worksheet so that before the first listing of each month it will insert a blank row with "mmm-yy" the month and the year as shown in the second table. Also after the last listing of the month I want a blank row to be inserted as a kind of divider between months. From there I want to fill in the two new columns as shown with the total deposits made each month and the total expenses from each month. The reason I am doing this in VBA is because I want everything to be dynamically updating because the lists could grow very long. Thanks!

[TABLE="class: outer_border, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]Date[/TD]
[TD="align: center"]Category[/TD]
[TD="align: center"]Value[/TD]
[/TR]
[TR]
[TD="align: center"]2014-03-20[/TD]
[TD="align: center"]Deposit[/TD]
[TD="align: center"]440[/TD]
[/TR]
[TR]
[TD="align: center"]2014-03-29[/TD]
[TD="align: center"]Deposit[/TD]
[TD="align: center"]600[/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-01[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-60.09[/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-01[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-77.87[/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-04[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-0.85[/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-05[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-7.88[/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-07[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-2[/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-08[/TD]
[TD="align: center"]Deposit[/TD]
[TD="align: center"]160.25[/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-08[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-3[/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-08[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-100[/TD]
[/TR]
</tbody>[/TABLE]


[TABLE="class: outer_border, width: 600"]
<tbody>[TR]
[TD="align: center"]Date[/TD]
[TD="align: center"]Category[/TD]
[TD="align: center"]Value[/TD]
[TD="align: center"]Total Deposits for Month[/TD]
[TD="align: center"]Total Expense for Month[/TD]
[/TR]
[TR]
[TD="align: center"]Mar-14[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2014-03-20[/TD]
[TD="align: center"]Deposit[/TD]
[TD="align: center"]440[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2014-03-29[/TD]
[TD="align: center"]Deposit[/TD]
[TD="align: center"]600[/TD]
[TD="align: center"]1040[/TD]
[TD="align: center"]0[/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]Apr-14[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-01[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-60.09[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-01[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-77.87[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-04[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-0.85[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-05[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-7.88[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-07[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-2.00[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-08[/TD]
[TD="align: center"]Deposit[/TD]
[TD="align: center"]160.25[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-08[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-3.00[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2014-04-08[/TD]
[TD="align: center"]Expense[/TD]
[TD="align: center"]-100.00[/TD]
[TD="align: center"]160.25[/TD]
[TD="align: center"]-251.69[/TD]
[/TR]
</tbody>[/TABLE]
 

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