ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sumproduct in VBA (https://www.excelbanter.com/excel-programming/327775-sumproduct-vba.html)

[email protected]

Sumproduct in VBA
 
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?


Bob Phillips[_6_]

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

--

HTH

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


wrote in message
oups.com...
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?





All times are GMT +1. The time now is 09:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com