您好我需要在vba上执行我的excel公式。这是公式:
=((SUMPRODUCT(-(Details!$C$7:$C$1182=A3),-(Details!$E$7:$E$1182=B3), -(Details!$S$7:$S$1182="Delivered"), -(Details!$G$7:$G$1182=C3), Details!$N$7:$N$1182)))
我的代码是:
ws1.Range("I2:I" & last) = Evaluate("SumProduct(-(Details!C = A3), -(Details!E = B3), -(Details!S = 'Delivered'), -(Details!G = C3), Details!N)")
我的sumproduct从其他工作表中获取值,但它不起作用。感谢。
答案 0 :(得分:0)
写入 - 而不是 - 用于逻辑测试
评估(“SumProduct( - (Details!C = A3), - (Details!E = B3), - (详情!S ='Delivered'), - (详情!G = C3),细节!N)“)