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
| If ComboBox1.Text = "" Then
MsgBox "Veuillez saisir le Nom de l'agent", vbCritical, "Champ obligatoir"
ComboBox1.SetFocus
ElseIf TextBox1.Text = "" Then
MsgBox "Veuillez saisir la date de début", vbCritical, "Champ obligatoir"
TextBox1.SetFocus
ElseIf BoxDateD2.Value = "" Then
MsgBox "Veuillez saisir la date de Fin", vbCritical, "Champ obligatoir"
BoxDateD2.SetFocus
ElseIf Label7.Value = "" Then
MsgBox "Veuillez saisir le type de Congé ", vbCritical, "Champ obligatoir"
Label7.SetFocus
ElseIf ComboBox4.Text = "" Then
MsgBox "Veuillez saisir le type de Congé ", vbCritical, "Champ obligatoir"
ComboBox4.SetFocus
Else
'on enregistre les données dans notre tableau'
Sheets("IN").Activate
ActiveSheet.Cells(numligneVide, 5) = ComboBox1.Text
ActiveSheet.Cells(numligneVide, 6) = TextBox1.Text
ActiveSheet.Cells(numligneVide, 7) = fomat(BoxDateD2.Value, "dd/mm/yyyy")
BoxDateD2.Value = Format(BoxDateD2.Value, "dd/mm/yyyy")
ActiveSheet.Cells(numligneVide, 8) = Format(Label7.Value, "dd/mm/yyyy")
Label7.Value = Format(Label7.Value, "dd/mm/yyyy")
ActiveSheet.Cells(numligneVide, 9) = ComboBox4.Text
End If |
Partager