Function MyColorSum(Ref_color As Range, Sum_range As Range)
Application.Volatile
Dim iCol As Integer
Dim rCell As Range
iCol = Ref_color.Interior.ColorIndex
For Each rCell In Sum_range
If iCol = rCell.Interior.ColorIndex Then
MyColorSum = MyColorSum + rCell.Value
End If
Next rCell
End Function
第一个参数是有颜色的单元格,第二个,要统计的区域,马上下班了,只能帮你到这里,希望你能领悟。
温馨提示:答案为网友推荐,仅供参考