Hi again,
Need your expert help on the following:
I have a formula in a certain sheet, that works perfectly:
=SUMPRODUCT(--(Orders!$M$2:$M$3000=Budget!D2),--(Orders!$B$2:$B$3000=Budget!I2),(Orders!$AC$2:$AC$3000))
Now I need to convert this formula into something that can work in a userform, based on certain selections entered by the user.
In the userform there are two text boxes, one is called TB_Unit_Name and the other is called TB_Unit_Model.
There is another text box called TB_Total_Units_On_Order
What I am trying to do is something that looks like the code below (which only represents what I am aiming for) but I don't know how to write it in VBA.
me.TB_Total_Units_on_Order.value =SUMPRODUCT(--(Orders!M2:M3000=me.TB_Unit_Name.value),--(Orders!B2:B3000=me.TB_Unit_Model.value),(Orders!AC2:AC3000))
What I need your help with, is the proper syntax for this calculation (or a different solution?).
BTW, just to clarify, whenever the form data is changing (based on user selection) and the data is in TB_Unit_Name & TB_Unit_Model changes - I need the form to show the total quantities that were ordered based on those two criteria.
In the data sheet "orders" there can be many lines that meet the two criteria, hence the need for sumproduct calculation.
I hope I have made myself clear :?
T.I.A.