Thread
:
function "sumproduct" in VBA environment
View Single Post
#
2
Posted to microsoft.public.excel.programming
papou[_3_]
external usenet poster
Posts: 31
function "sumproduct" in VBA environment
Hello
If your sumproduct formula works, use Evaluate:
MyAns = Evaluate("=SUMPRODUCT(--(yard="BSHKY"),--(ac_name="Yard
Trucks"),amt)")
HTH
Cordially
Pascal
"aw" a écrit dans le message de news:
...
Dear Sir / Madam,
Could anyone can help to translate the worksheet function - "sumproduct"
(as
below) into VBA??
=SUMPRODUCT(--(yard="BSHKY"),--(ac_name="Yard Trucks"),amt)
Remark : "Yard", "ac_name" & "amt" are pre-defined range.
My working as follow : (but run-time error '13' type mismatch appear)
Sub sp()
a = InputBox("Yard")
b = InputBox("A/C name")
MyAns = Application.WorksheetFunction.SumProduct((Range("y ard") = "a"),
(Range("ac_name") = "b"), Range("amt"))
End Sub
!!!Thank you so much!!!
Best rgds // aw
--
aw
Reply With Quote
papou[_3_]
View Public Profile
Find all posts by papou[_3_]