In the first example that follow I made the assumption that you want blue cells equal to 1 and red cells equal to 0.
Sub ifBlueMakeCellValueEQ1()
Dim r As Range
Dim rCell As Range
Set r = Selection.Cells
For Each rCell In r
With rCell
Select Case .Interior.Color
Case Is = vbBlue
.Value = 1
Case Is = vbRed
.Value = 0
End Select
End With
Next
End Sub
to use this, first select a range of cells then run the macro.
If that works then ignore the remainder of this answer
If the values of your cells aren't changing to 1 or 0 it means your cell's colors aren't equal to excel's idea of blue and red (vbBlue and vbRed, respectively).
If you run into this problem do this: click on a 'blue' cell. Go to the VBE Immediate window, type the command "?activecell.interior.colorindex", hit enter. The integer that is returned should be used in the following code in place of {BLUECOLORINDEX}
Sub ifBlueMakeCellValueEQ1()
Dim r As Range
Dim rCell As Range
Set r = Selection.Cells
For Each rCell In r
If rCell.Interior.ColorIndex = {BLUECOLORINDEX} Then rCell.Value = 1
Next
End Sub