首页 > 电脑

如何用EXCEL函数统计同货号带颜色的数量?

更新时间2019-03-07 06:01:46

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

不适用条件格式生成的颜色。

上一篇:您好,如果层次分析法中的判断矩阵不满足一致性检验,那如何进行优化改进呢

下一篇:查询表1a字段减表2b字段数据大于0则修改表2c字段等于T