http://jingyan.baidu.com/article/48a42057a8fbffa925250469.html
这里有详细说明
另外他的代码 缺少结束语句,我给补充完整, 用法他已经说的很清楚了
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
excel带底纹单元格计算能够实现