You didn't provide any specifics, but use the following code to count the number of yellow cells in the range A1:A10:
Dim x As Integer
For Each cell In Range("A1:A10")
If cell.Interior.Color = 65535 Then
x = x + 1
MsgBox "There are " & x & " yellow cells."
Use the macro recorder to find the color code for other colors.
To count cell with specific text, you can use a formula: