Sumproduct in VBA

T

tanglk

The error i get is type mismatch for this sumproduct function in VBA:

r = WorksheetFunction.SumProduct((Left(Range("I1:I31"), 3) = "XCH"),
(Range("J1:J31")))

same happen if i put array in.

Do you have any idea?
 
B

Bob Phillips

Try
r=Evaluate("=SumProduct(--(Left(I1:I31, 3)=""XCH""),J1:J31)")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top