在Excel中如何统计不同颜色单元格底纹的单元格个数

如题所述

第1个回答  2020-01-02
excel2003用
按alt+f11,插入
模块
写程
Function
SUMColor(rag1
As
Range,
rag2
As
Range)
Application.Volatile
For
Each
i
In
rag2
If
i.Interior.ColorIndex
=
rag1.Interior.ColorIndex
Then
SUMColor
=
SUMColor
+
1
End
If
Next
End
Function
需要统计工作表面找空白单元格(例D2)填充要统计数颜色隔壁单元格写:=SUMColor(D2,$A$1:$C$22)其$A$1:$C$22需要统计区域根据需求自改
相似回答
大家正在搜