Public WithEvents txt As MSForms.TextBox
Private Sub txt_Change()
Dim N As String, partie As Byte, Joueur As Byte, j As Byte, i, s As Variant
N = txt.Name
With UserForm1
If txt > 0 Then
Joueur = 1 + (Right(N, Len(N) - 1) + 3) Mod 4
partie = Int((Right(N, Len(N) - 1) - 1) / 4) + 1
For j = 1 To 4
If j <> Joueur And txt <> "" Then
.Controls("T" & j + 4 * (partie - 1)) = -CDbl(txt.Value) / 3
End If
Next
End If
For Each i In Array(.T1, .T5, .T9, .T13, .T17, .T21, .T25, .T29)
If i <> "" Then s = s + CDbl(i): .TO1 = s
Next i
s = 0
For Each i In Array(.T2, .T6, .T10, .T14, .T18, .T22, .T26, .T30)
If i <> "" Then s = s + CDbl(i): .TO2 = s
Next i
s = 0
For Each i In Array(.T3, .T7, .T11, .T15, .T19, .T23, .T27, .T31)
If i <> "" Then s = s + CDbl(i): .TO3 = s
Next i
s = 0
For Each i In Array(.T4, .T8, .T12, .T16, .T20, .T24, .T28, .T32)
If i <> "" Then s = s + CDbl(i): .TO4 = s
Next i
End With
End Sub