Function cc()
Dim rng As Range
For Each rng In Range("A1:G10")
If rng.Interior.Color = RGB(255, 255, 0) Then
cc = 1 + cc
End If
Next rng
End Function