SumProduct/Concatenate/VBA Question

zdodson

Board Regular
Joined
Feb 29, 2012
Messages
124
Hello,


I am working within a VBA userform that has two comboboxes:

cboYourName
cboOppName

Once values have been selected from these comboboxes, it will return a value in the subsequent textbox that is based on this formula:

=CONCATENATE("AFF: ",SUMPRODUCT(--($W$2:$W$13=$W$18),--($X:$X=$X$18)),"/NEG: ",SUMPRODUCT(--($W:$W=$X$18),--($X:$X=$W$18)))

The formula works if it is in the worksheet itself, but I am having some trouble once I put it in to VBA. The "$W$18" and "$X$18" criterion I need to be the values of cboYourName and cboOppName respectively.

Can someone point me in the right direction on how to programmatically input sumproduct formulas in Excel VBA?


Thanks,

Zack
 
I'll look at it tonight in sample, and get back with you. I am pretty sure--now that I am thinking through it--that it could work.

The simplification of the code that you gave me (i.e. naming things as variables using "var") helped immensely.
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

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