Option Explicit
Dim LockTogle As Boolean
Private Sub ToggleButton1_Click()
Dim ValBoolean As Boolean
Dim x As Byte
If LockTogle = False Then
With Me.ToggleButton1
ValBoolean = IIf(.Value = True, True, False)
For x = 1 To 3
Me.Controls('CheckBox' & x) = ValBoolean
Next
End With
End If
With Me.ToggleButton1
.Caption = IIf(.Value = True, 'Desélectionner tout', 'Sélectionner tout')
End With
End Sub
Private Sub UserForm_Initialize()
End Sub
Private Sub CheckBox1_Click()
StatusChecker
End Sub
Private Sub CheckBox2_Click()
StatusChecker
End Sub
Private Sub CheckBox3_Click()
StatusChecker
End Sub
Private Sub StatusChecker()
LockTogle = True
If CheckBox1.Value = True And CheckBox2.Value = True And CheckBox3.Value = True Then
ToggleButton1.Value = True
Else
ToggleButton1.Value = False
End If
LockTogle = False
End Sub