Private Sub CommandButton1_Click()
'Vérif des saisies
If Trim(TextBox1) = "" Then
MsgBox "Veuillez saisir le nom."
TextBox1.SetFocus
Exit Sub
ElseIf Trim(TextBox2) = "" Then
MsgBox "Veuillez saisir le prénom."
TextBox2.SetFocus
Exit Sub
ElseIf Not (OptionButton1 Or OptionButton2 Or OptionButton3) Then
MsgBox "Veuillez saisir la situation."
Frame1.SetFocus
Exit Sub
ElseIf Not (CheckBox1 Or CheckBox2 Or CheckBox3) Then
MsgBox "Veuillez saisir les justificatifs."
Frame2.SetFocus
Exit Sub
Else
'Tous les champs sont saisis -> transfert sur Feuille "DONNE"
With Sheets("DONNE")
.Range("B5") = TextBox1
.Range("B6") = TextBox2
.Range("B7") = _
IIf(OptionButton1, OptionButton1.Caption, _
IIf(OptionButton2, OptionButton2.Caption, OptionButton3.Caption))
.Range("B10") = _
IIf(CheckBox1, CheckBox1.Caption, "") & _
IIf(CheckBox2, ", " & CheckBox2.Caption, "") & _
IIf(CheckBox3, ", " & CheckBox3.Caption, "")
If Left(.Range("B10"), 2) = ", " Then .Range("B10") = Mid(.Range("B10"), 3)
End With
Unload Me
End If
End Sub