how to change the value of a cell based on a comaprison of 2 other cells

Friends

I wish to evaluate the value of 2 cells and if equle change the value of a 3rd
so if i have 3 colums

b c d
111 222
222 333
111 212

if c1 is == to b2 change d2 to something , like make it a 1 , or blue
in the above this is True 222=222
and this evaluation goes down the columns
if c2 == to b3 change d3
and in this case it is not , 333 != 111 , so do nothing
and march down these columns in this stair step evaluation

Thanks

try this macro

Sub Macro()

Dim i As Integer
Const start_row = 3 'for example - you must tell the macro the number of the row you will start comparison from
Const end_row = 23 'for example - you must tell the macro the number of the row you will do comparison to

For i = start_row To end_row
If Range("C" + Format(i - 1)).Value = Range("B" + Format(i)).Value Then
Range("D" + Format(i)).Value = 1 ' or do whith cell D"i" anything you want
End If
Next i
End Sub