Bonjour,
"Date" est une fonction réservée par Excel,
il ne faut pas l'utiliser comme variable. (ici, j'ai mis "daT")
Voici un exemple, sans trop de conviction !
Sub Données()
Dim daT, Rep
If IsDate(Range("a2")) Then 'si déjà date en A2
Rep = MsgBox("On change la date ?", vbYesNo + vbCritical + vbDefaultButton2, "Inscription")
If Rep = vbNo Then GoTo Suite
End If
Do
daT = Application.InputBox("Quelle est la date ?", "Date", , Type:=1)
If daT = False Then Exit Sub 'bouton Annuler
Loop While daT = ""
Range("a2") = Format(CDate(daT), "m/d/yyyy")
Suite:
Rep = Application.InputBox("Quel est le nom ?")
If Rep = "" Or Rep = False Then Range("b2").ClearContents: Exit Sub
Range("b2") = Rep
End Sub
Amicalement
Claude