Sub RaceClash()
Dim Race1(1 To 144) As Integer
Dim Race2(1 To 144) As Integer
Dim Choice(1 To 144) As Integer
Dim R1 As Integer, R2 As Integer, A As Integer, B As Integer
Dim Clash As Integer

For j = 5 To 35
For i = 1 To 141
Race1(i) = Worksheets(3).Cells(1, i).Value
Race2(i) = Worksheets(3).Cells(2, i).Value
Next i
Next j

For j = 5 To 35

For i = 1 To 141
Choice(i) = Worksheets(2).Cells(j, i + 5).Value
Next i

Clash = 0

For i = 1 To 141

R1 = Race1(i)
R2 = Race2(i)

If Choice(R1) = 1 Then
A = 1
Else
A = 0
End If

If Choice(R2) = 1 Then
B = 1
Else
B = 0
End If

If A + B = 2 Then
Clash = Clash + 1
End If


If Clash = 0 Then
Worksheets(2).Cells(j, 149).Value = 0
ElseIf Clash > 0 Then
Worksheets(2).Cells(j, 149).Value = 1
End If

Next i



Next j

End Sub