2

谁能解释我能做些什么来解决这个问题?

在此处输入图像描述

这是当前代码:

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))
4

1 回答 1

3

你错过了Range之前B4:B和其他人的类似情况。它应该是

SumFinalUnusedSPQCement = Application.WorksheetFunction.SumIf( _
                                      Range("V4:V" & lastRow + 3), _
                                      ">0", _
                                      Range("B4:B" & lastRow + 3) _
                                      )

你也不需要WorksheetFunction.Sum

于 2013-04-25T08:02:14.960 回答