level 13
Function colorcount(rg As Range, rg1 As Range) As Integer
Dim x, reg As Range
x = rg1.Interior.Color
For Each reg In rg
If reg.Interior.Color = x Then
colorcount = colorcount + 1
End If
Next
End Function
自定义函数,=colorcount(要统计某个颜色的单元格区域,具有某个颜色的单元格)
第2个区域选择单个具有颜色的单个单元格
比如:=colorcount(a16:bg16,bl11),统计A16:BG16中具有BL11单元格颜色的数量
2013年10月28日 12点10分
4