Private Sub CBValider_Click()
If Not IsDate(TextBox4) Or Len(TextBox4) < 10 Then MsgBox "la date n'est pas valide": Exit Sub
If MsgBox("La nouvelle saisie est-elle confirmée ?", _
vbYesNo, "Demande confirmation de saise") = vbYes Then
With Sheets("Ecritures")
.[B10].Value = DateValue(TextBox4)
.[E10:G10].Value = Array(CboComptes, CboCatégories, CboSousCat)
.[I10].Value = TextBox1
.[L10].Value = CboModePaie
With .[N10:O10]
.Value = Array(IIf(Val(TextBox2) > 0, Val(TextBox2), ""), IIf(Val(TextBox5) > 0, Val(TextBox5), ""))
.Cells.NumberFormat = "#,##0.00 $"
End With
End With
End If
Unload Me
End Sub