Option Explicit
Private Induit As Boolean
Private Sub SpinButton1_Change(): If Induit Then Exit Sub
Ajuster Me.[B1].Value - SpinButton1.Value, SpinButton2, SpinButton3
End Sub
Private Sub SpinButton2_Change(): If Induit Then Exit Sub
Ajuster Me.[B1].Value - SpinButton2.Value, SpinButton1, SpinButton3
End Sub
Private Sub SpinButton3_Change(): If Induit Then Exit Sub
Ajuster Me.[B1].Value - SpinButton3.Value, SpinButton1, SpinButton2
End Sub
Sub Ajuster(TotMax As Currency, ByVal SB1 As MSForms.SpinButton, ByVal SB2 As MSForms.SpinButton)
Dim TotAct As Currency
If Induit Then Exit Sub
TotAct = SB1.Value + SB2.Value: If TotAct <= TotMax Then Exit Sub
Induit = True
If SB1.Value > 0 Then SB1.Value = SB1.Value - 100
If SB2.Value > 0 Then SB2.Value = SB2.Value - 100
Induit = False
End Sub