excel中如何将同列中相同颜色的字体数值相加
我有一列数据,分为红、绿、黑3种颜色字体,我现在只想在某一个中自动显示此列中红色字体的数值和,如何列公式?
用自定义函数zts
语法zts(rag As Range, ColorrRag As Range)
rag——求和区域
ColorrRag ——字体颜色的单元格
代码:
Public Function zts(rag As Range, ColorrRag As Range)
'字体是某一颜色的数字单元格个数,zts——字体色
For Each cel In rag
If cel.Value <> "" And IsNumeric(cel.Value) And _
cel.Font.ColorIndex = _
ColorrRag.Font.ColorIndex Then n = n + cel.value
Next cel
zts = n
End Function
下一篇:为什么我的渐变工具用不了了
上一篇:迅雷转换器与狸窝转换器是一家的吗
热门标签: