Private Sub cmdvalidereglement_Click()
If txtdate = "" Then
msgbox (" indiquer la date ")
Exit Sub
End If
If msgbox("Êtes-vous sûr de vouloir valider le paiement ?", vbYesNo, "Validation définitif") = vbYes Then
If sup = vbCancel Then Exit Sub
Dim t() As Variant, i As Byte
t = Array("JanvierD", "FevrierD")
For i = 0 To UBound(t)
Set cel = Sheets(t(i)).Columns(1).Find(txtnumero, LookIn:=xlValues, lookat:=xlWhole)
.Cells(1, 8) = txtmontantréglé
Next i
Dim cel As Range
Set cel = Sheets("Dépense").Columns(1).Find(txtnumero, LookIn:=xlValues, lookat:=xlWhole)
If cel Is Nothing Then GoTo erreur
With cel
.Cells(1, 9) = ComboBoxmois
.Cells(1, 7) = txtmontantréglé
.Cells(1, 8) = txtdate
If OptionButton14 = True Then
TextBoxcheque.Visible = True
ElseIf OptionButton14 = False Then
TextBoxcheque.Visible = False
End If
Unload Me
End With
Exit Sub
erreur:
End If
End Sub