VBA code for SUMIFS

Bazligton

New Member
Joined
May 16, 2015
Messages
5
Hi,

Everyday at work I enter the SUMIFS formula on a worksheet to calculate the total dollar amount from a Pivot-table(1). I use the below formula

The Pivot table is on the "Weekly Revenue" sheet and the Totals (formula) is on another sheet called "BacklogReview"


<colgroup><col width="82"></colgroup><tbody>
[TD="class: xl69, width: 82"]=SUMIFS('WeeklyRevenue'!E:E,'WeeklyRevenue'!D:D,">="'BacklogReview'!C32,'WeeklyRevenue'!D:D<"'BacklogReview'!C33)

and copy it down. The formula allows the totals to appear any where on the spreadsheet with dates. The value for the cell "Past" and "26 Mar" is calculated separately otherwise the values are incorrect.

I would like VB code that will work out the values for the "Past" and for the last day of the month "26 Mar" when selecting a button.;)

Please see below for how the values are set up on the sheet

Apologies if not very clear who ever can help me on this I would be very greatful

Many thanks

[/TD]

</tbody>

<colgroup><col style="mso-width-source:userset;mso-width-alt:3181;width:52pt" width="70"> <col style="mso-width-source:userset;mso-width-alt:3766;width:62pt" width="82"> </colgroup><tbody>
</tbody>



<colgroup><col style="mso-width-source:userset;mso-width-alt:3181;width:52pt" width="70"> <col style="mso-width-source:userset;mso-width-alt:3328;width:55pt" width="73"> </colgroup><tbody>
[TD="class: xl68, width: 73"]

<colgroup><col style="mso-width-source:userset;mso-width-alt:3181;width:52pt" width="70"> <col style="mso-width-source:userset;mso-width-alt:3328;width:55pt" width="73"> </colgroup><tbody>
[TD="class: xl69, width: 70"]Past
[/TD]
[TD="class: xl70, width: 73"]$7,715,447[/TD]

[TD="class: xl71"]01-Jan
[/TD]
[TD="class: xl72"]$3,375,060[/TD]

[TD="class: xl71"]08-Jan[/TD]
[TD="class: xl73"]$483,787
[/TD]

[TD="class: xl71"]15-Jan[/TD]
[TD="class: xl73"]$450,817[/TD]

[TD="class: xl71"]22-Jan[/TD]
[TD="class: xl73"]$42,926[/TD]

[TD="class: xl71"]29-Jan[/TD]
[TD="class: xl73"]$2,273,545
[/TD]

[TD="class: xl71"]05-Feb[/TD]
[TD="class: xl73"]$191,500[/TD]

[TD="class: xl71"]12-Feb[/TD]
[TD="class: xl73"]$0[/TD]

[TD="class: xl71"]19-Feb[/TD]
[TD="class: xl73"]$0[/TD]

[TD="class: xl71"]26-Feb[/TD]
[TD="class: xl73"]$24,039[/TD]

[TD="class: xl71"]05-Mar[/TD]
[TD="class: xl73"]$0[/TD]

[TD="class: xl71"]12-Mar[/TD]
[TD="class: xl73"]$224,583[/TD]

[TD="class: xl71"]19-Mar[/TD]
[TD="class: xl73"]$143,540[/TD]

[TD="class: xl71"]26-Mar[/TD]
[TD="class: xl73"]$67,412[/TD]

</tbody>
[/TD]

[TD="class: xl70"][/TD]

[TD="class: xl71"][/TD]

[TD="class: xl71"][/TD]

[TD="class: xl69"][/TD]
[TD="class: xl71"][/TD]

[TD="class: xl69"][/TD]
[TD="class: xl71"][/TD]

[TD="class: xl69"][/TD]
[TD="class: xl71"][/TD]

[TD="class: xl69"][/TD]
[TD="class: xl71"][/TD]

[TD="class: xl69"][/TD]
[TD="class: xl71"][/TD]

</tbody>





<tbody>

</tbody>
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,223,907
Messages
6,175,301
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