您可以使用VBA函数对所有着色的单元格求和:
代码:
Public Function ColorSum(myRange As Range) As Variant
Dim rngCell As Range
Dim total As Variant
For Each rngCell In myRange.Cells
If rngCell.Interior.ColorIndex <> -4142 Then
total = total + rngCell.Offset(0, 1).Value
End If
Next rngCell
ColorSum = total
End Function