Private Sub CommandButton1_Click()
If Not IsDate(TextBox9) Then
MsgBox "Veuillez saisir la date de réception ""jj/mm/aaaa""" & vbCr _
& " Ex: 01/01/2008", vbExclamation
Exit Sub
End If
If Not IsDate(TextBox6) Then
MsgBox "Veuillez saisir la date de transmission ""jj/mm/aaaa""" & vbCr _
& " Ex: 01/01/2008", vbExclamation
Exit Sub
End If
If TextBox7.Visible And Not IsDate(TextBox7.Text) Then
MsgBox "Veuillez saisir la date de classement ""jj/mm/aaaa""" & vbCr _
& " Ex: 01/01/2008", vbExclamation
Exit Sub
End If
If ComboBox5.ListIndex = -1 Then
MsgBox ComboBox5.Value
MsgBox "Veuillez saisir l'état du dossier ""jj/mm/aaaa""" & vbCr _
& " Ex: 01/01/2008", vbExclamation
Exit Sub
End If
'Insertion d'une nouvelle ligne dans la base de données avec recopie des formules
Sheets("Base").Select
Range("A6").Select
Application.CutCopyMode = True
Selection.EntireRow.Insert
Rows("6:6").Select
Selection.RowHeight = 50
Selection.Interior.ColorIndex = xlNone
Selection.Font.Bold = False
Range("N5:Q5").Select
Selection.AutoFill Destination:=Range("N5:Q6"), Type:=xlFillCopy
'Insertion des cellules dans la base de données
Range("A6").Value = TextBox2.Value
Range("C6").Value = TextBox3.Value
Range("D6").Value = TextBox4.Value
Range("E6").Value = ComboBox1.Value
Range("F6").Value = ComboBox2.Value
Range("B6") = CDate(TextBox9.Text)
Range("G6").Value = TextBox5.Value
If ComboBox3.ListIndex > -1 Then Range("H6").Value = ComboBox3.Value
Range("B6") = CDate(TextBox6.Text)
Range("M6").Value = ComboBox5.Value
If ComboBox4.ListIndex > -1 Then Range("K6").Value = ComboBox4.Value
Range("J6") = CDate(TextBox7.Text)
Range("L6").Value = TextBox8.Value
Range("A6").Select
[B1] = CInt(TextBox2.Value)
Unload USFSaisie
End Sub