Dim Donnee As Variant
Dim varDate As Date
debut:
ladate = Application.InputBox("Saisissez le mois et l'année au format 04/2010", "Date fin de Mois")
If ladate = "" Then
MsgBox " opération annulée"
Exit Sub
End If
'Intercepte l'utilisation du bouton "Annuler" et la croix de fermeture.
If VarType(ladate) = vbBoolean Then
MsgBox " opération annulée"
Exit Sub
End If
On Error Resume Next
ladate = CDate("15/" & ladate)
If Err <> 0 Then Err.Clear: MsgBox "Recommencer": GoTo debut
MsgBox CDate(DateSerial(Year(ladate), Month(ladate) + 1, 0))