1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| Private Sub CommandButton5_Click()
For i = 1 To 9
Me.Controls("CheckBox" & i).Value = False
Next i
Me.ComboBox1.ListIndex = -1
Me.ComboBox2.ListIndex = -1
Me.TextBox1.Text = ""
Me.TextBox2.Text = ""
End Sub
Private Sub CommandButton6_Click()
Ligne = Ligne + 1
Cells(Ligne, 1) = TextBox1
Cells(Ligne, 2) = TextBox2
Cells(Ligne, 3) = TextBox3
Cells(Ligne, 3) = Me.ComboBox2.Value
Cells(Ligne, 4) = Me.ComboBox1.Value
Cells(Ligne, 14) = Me.TextBox3.Value
Cells(Ligne, 5).Resize(, 9).Value = 0
If CheckBox9.Value And (Me.CheckBox1.Value Or Me.CheckBox2.Value) Then
MsgBox "Erreur de saisie"
Exit Sub
End If
If Me.CheckBox1.Value And Me.CheckBox2.Value Then
MsgBox "Erreur de saisie"
Exit Sub
End If
If CheckBox1.Value Then
Cells(Ligne, "J").Value = 1
End If
If CheckBox2.Value Then
Cells(Ligne, "L").Value = 1
End If
If CheckBox3.Value Then
Cells(Ligne, "M").Value = 1
End If
If CheckBox4.Value Then
Cells(Ligne, "E").Value = 1
End If
If CheckBox5.Value Then
Cells(Ligne, "F").Value = 1
End If
If CheckBox6.Value Then
Cells(Ligne, "G").Value = 1
End If
If CheckBox7.Value Then
Cells(Ligne, "H").Value = 1
End If
If CheckBox8.Value Then
Cells(Ligne, "I").Value = 1
End If
If CheckBox9.Value Then
Cells(Ligne, "K").Value = 1
End If
For i = 1 To 9
Me.Controls("CheckBox" & i).Value = False
Next i
End Sub |
Partager