```
Sub ColorCells()
For i = 1 To 5000
Cells(i, Application.Match(Application.Max(Range(Cells(i, 1), Cells(i, 3))), Range(Cells(i, 1), Cells(i, 3)), 0)).Interior.Color = vbRed
Cells(i, Application.Match(Application.Min(Range(Cells(i, 1), Cells(i, 3))), Range(Cells(i, 1), Cells(i, 3)), 0)).Interior.Color = vbGreen
Do
s = Application.RandBetween(1, 3)
Loop While s = Application.Match(Application.Max(Range(Cells(i, 1), Cells(i, 3))), Range(Cells(i, 1), Cells(i, 3)), 0) Or s = Application.Match(Application.Min(Range(Cells(i, 1), Cells(i, 3))), Range(Cells(i, 1), Cells(i, 3)), 0)
Cells(i, s).Interior.Color = vbYellow
Next
End Sub
```