ALT+F11 插入模块
Function sumcol(rng As Range, icel As Range) As Single
Dim cel As Range
sumcol = 0
For Each cel In rng
If cel.Font.ColorIndex = icel.Font.ColorIndex Then
sumcol = sumcol + cel.Value
End If
Next
End Function
在需要求和的单元格里输入 =SUMCOL(A1:A6,A1)
表示求A1:A6,单元格里字体颜色数据之和,后面的A1,表示字体颜色单元格,根据实际情况修改即可。
=SUMCOL(A1:A6,A1)
温馨提示:答案为网友推荐,仅供参考