有谁可以解释我能做些什么来解决这个问题?
这是当前的代码:
SumFinalUnusedSPQCement = WorksheetFunction.Sum(Application.WorksheetFunction.SumIf(Range("V4:V" & lastRow + 3), ">0", "B4:B" & lastRow + 3))
SumFinalUnusedSPQSand = WorksheetFunction.Sum(Application.WorksheetFunction.SumIf(Range("W4:W" & lastRow + 3), ">0", "C4:C" & lastRow + 3))
SumFinalUnusedSPQAggregate = WorksheetFunction.Sum(Application.WorksheetFunction.SumIf(Range("X4:X" & lastRow + 3), ">0", "D4:D" & lastRow + 3))
答案 0 :(得分:2)
您在Range
之前缺少B4:B
,而其他人则相同。它应该是
SumFinalUnusedSPQCement = Application.WorksheetFunction.SumIf( _
Range("V4:V" & lastRow + 3), _
">0", _
Range("B4:B" & lastRow + 3) _
)
此外,您不需要WorksheetFunction.Sum
。