你需要使用VBA Function- Function CountBlueCells(rng As Range) As Long
- Dim cell As Range
- Dim count As Long
- count = 0
- For Each cell In rng
- If cell.Interior.Color = RGB(0, 0, 255) Then ' Pure blue
- count = count + 1
- End If
- Next cell
- CountBlueCells = count
- End Function
复制代码 然后在 I40 输入公式 =CountBlueCells(C40:H40) |