VBA Excel Userform Code Equivelent of SUMIFS()

minkeyt

New Member
Joined
Feb 7, 2014
Messages
1
Hi There,

Does anyone know what vba code I would use to perform a sort of SUMIFS() Formula in an excel userform, gathering relevant data from a spread sheet table? I have a userform with blank labels and a button. And I want the labels to display a total of specific items in my spread sheet table after pressing the button.

example of table:

a1 $300,000
b1 $100,000
a1 $150,000
a1 $311,000
c1 $400,000

and say I want the label in my userform to display the total of only the "a1"s and "b1"s. not the "c1"s. normally in excel I would use =sumifs(sumrange,criteriarange_a1, "a1", criteriarange_b1, "b1"). But what would I use to calculate this in the userform upon butt*******()?

Any help appreciated!
 

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