I have Quantities in column Q, Unit Prices in column U and Account Codes in column T
On the worksheet I can successfully sum the total of each Account Code via =SUMPRODUCT(--(T2:T44="200-002"),Q2:Q44,R2:R44), but when I try the same thing in VBA, I get a type mismatch error.
What am I overlooking?
On the worksheet I can successfully sum the total of each Account Code via =SUMPRODUCT(--(T2:T44="200-002"),Q2:Q44,R2:R44), but when I try the same thing in VBA, I get a type mismatch error.
VBA Code:
XeroWETRetail = Application.WorksheetFunction.SumProduct(--(Xero.Sheets("Xero Sales Invoice").Range("T2:T" & XeroRow) = "200-002"), _
Xero.Sheets("Xero Sales Invoice").Range("Q2:Q" & XeroRow), Xero.Sheets("Xero Sales Invoice").Range("R2:R" & XeroRow))
What am I overlooking?