If Not Intersect(Target, [madate]) Is Nothing Then
[d4] = VérifieEntréeDate2([madate])
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, [madate]) Is Nothing Then
If IsDate([madate].Text) Then
d = [madate].Text: Target.NumberFormat = "General": Target.Value = "'" & CStr(d)
End If
Else
If IsDate(Replace([madate].Text, ",", "")) Then [madate] = CDate(Format([madate].Text, "m/d/yyyy"))
End If
End Sub
Function VérifieEntréeDate2(cel As Variant) As Boolean
'Vérifie si l'entrée est bien une date sous forme "jj/mm/aaaa"
'patricktoulon
VérifieEntréeDate2 = IsDate(cel.Value) And Format(cel.Text, "dd/mm/yyyy") = cel.Text
End Function