1,按背景颜色统计个数
Function Countcolor(col As Range, countrange As Range)
Dim icell As Range
Application.Volatile
For Each icell In countrange
If icell.Interior.ColorIndex = col.Interior.ColorIndex Then
Countcolor = Countcolor + 1
End If
Next icell
End Function
Function Countcolor(col As Range, countrange As Range)
Dim icell As Range
Application.Volatile
For Each icell In countrange
If icell.Interior.ColorIndex = col.Interior.ColorIndex Then
Countcolor = Countcolor + 1
End If
Next icell
End Function