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
| Option Explicit
Dim Ws As Worksheet
Private Sub cmdnouveau_Click()
Dim L As Integer
If MsgBox("Confirmez-vous l'insertion de cette nouvelle saisie ?", vbYesNo, "Demande de confirmation d'ajout") = vbYes Then
'Pour placer le nouvel enregistrement à la premiere ligne du tableau, non vide
L = Sheets("ESSAI 1").Range("A100").End(xlUp).Row + 1
Range("A" & L).Value = txtacte
Range("B" & L).Value = txtdaterencontre
Range("C" & L).Value = txtdatebapteme
Range("D" & L).Value = txtnom
Range("E" & L).Value = txtprenom
End If
Unload Me
UserForm1.Show
End Sub
Private Sub cmdmodifier_Click()
Dim Ligne As Long
Dim I As Integer
If MsgBox("Confirmez-vous la modification de cette saisie ?", vbYesNo, "Demande de confirmation de modification") = vbYes Then
If txtacte = -1 Then Exit Sub
Ligne = txtacte + 2
Ws.Cells(Ligne, "B") = "txtdaterencontre"
For I = 1 To 5
If txtacte("txtacte" & I).Visible = True Then
Ws.Cells(Ligne, I + 2) = ("txtacte" & I)
End If
Next I
End If
Unload Me
UserForm1.Show
End Sub
Private Sub cmdquitter_Click()
Unload Me
End Sub |
Partager