Bonjours a tous,
SVP mon problème est assez simple a expliquer mais je n'arrive pas a consolider des conditions
SVP comment puis je réunir les deux blocs suivants ( 1 et 2) car le premier bloc marche bien sauf qu'il permet la saisi de date incohérente style 46/99/2001 et j'aimerai y remédier
1er :
saisie_date:
dateRecrutement = InputBox("saisir l'année en cour", "Mise à jour annuel", Format(Date, "dd/mm/yyyy"))
If dateRecrutement = "" Then
MsgBox "Aucune date de saisie" & Chr(10) & "Veuillez recommencer l'opération", vbExclamation
GoTo saisie_date
Exit Sub
End If
If dateRecrutement <> Format(dateRecrutement, "dd/mm/yyyy") Then
MsgBox "le format doit être jj/mm/aaaa !"
GoTo saisie_date
End If
2em: (pour celui la même la syntaxe j'en suis pas sur!)
With dateRecrutement
If mm < 0 Or mm > 12 Then
MsgBox " Mois incorrect", vbExclamation
Else
If dd < 0 Or dd > 31 Then
MsgBox "date ?j0urs} incorrect", vbExclamation
Else
If mm = 2 And dd >= 30 Then
MsgBox "date jours impossible en février", vbExclamation
End If
End If
End If
End With
je reste dans l'attente Merci.