如何用EXCEL函数统计同货号带颜色的数量?
Public Function tcs(rag As Range, ColorrRag As Range)
'填充某一颜色的数字单元格个数,tcs——填充色
For Each cel In rag
If cel.Value <> "" And IsNumeric(cel.Value) And _
cel.Interior.ColorIndex = _
ColorrRag.Interior.ColorIndex Then n = n + 1
Next cel
tcs = n
End Function
================================
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 + 1
Next cel
zts = n
End Function
不适用条件格式生成的颜色。
热门标签: