Option Explicit
Sub Effectif()
Dim n&: n = Cells(Rows.Count, 1).End(3).Row: If n = 1 Then Exit Sub
Application.ScreenUpdating = 0: [K5] = ""
If [I5] = "" Or [J5] = "" Then Exit Sub
If [I5] = [J5] Then Exit Sub
Dim MT$(1), t%, i&, j As Byte, k As Byte
MT(0) = [I5]: MT(1) = [J5]
For i = 2 To n
For j = 3 To 5 Step 2
With Cells(i, j)
For k = 0 To 1
If .Value = MT(k) And .Offset(, 1) = MT(1 - k) Then t = t + 1
Next k
End With
Next j
Next i
[K5] = t
End Sub