Private Sub CommandButton1_Click()
Dim i As Variant
If Not IsDate([A2]) Then [A2].Select: MsgBox "Entrez une date valide !", , "Date anniversaire": Exit Sub
i = Application.Match(CLng(CDate([A2])), Range("A3:A" & Rows.Count), 0)
If IsError(i) Then [A2].Select: MsgBox "Date introuvable !", , "Date anniversaire": Exit Sub
If Not IsDate([B2]) Then [B2].Select: MsgBox "Entrez une date valide !", , "Date de naissance": Exit Sub
If DateAdd("yyyy", Year([A2]) - Year([B2]), [B2]) <> [A2] Then MsgBox "Les dates ne concordent pas !": Exit Sub
If Trim([C2]) = "" Then [C2].Select: MsgBox "Entrez le nom !", , "Nom": Exit Sub
If Trim([D2]) = "" Then [D2].Select: MsgBox "Entrez le prénom !", , "Prénom": Exit Sub
If Cells(i + 2, 1) = [A2] And Cells(i + 2, 2) <> "" _
And (LCase(Cells(i + 2, 3)) <> LCase([C2]) Or LCase(Cells(i + 2, 4)) <> LCase([D2])) Then Rows(i + 2).Insert 'insère une ligne
Cells(i + 2, 1).Resize(, 4) = [A2:D2].Value 'copie les valeurs
ActiveWindow.ScrollRow = i + 2 'cadrage
End Sub