Sub TheDate()
Dim dat As Long, t As String, i As Variant, j As Variant
dat = Date + 2
t = Format(dat, "dd/mm/yyyy")
With Feuil1
i = Application.Match("*" & t & "*", .[H:H], 0)
If IsError(i) Then i = 9 ^ 9
j = Application.Match(dat, .[H:H], 0)
If IsNumeric(j) Then If j < i Then i = j
If i < 9 ^ 9 Then
Beep 2000, 500
Beep 2000, 500
Beep 2000, 500
MsgBox "la Prochaine date : " & t & " exist. elle est representée par " & _
"la litem " & i & " du tableau. " & "Sous le N°: " & .Cells(i, 24) & " , .Lieu :" & .Cells(i, 25), 64, "Résultat"
Exit Sub
End If
End With
MsgBox "résultat négatif. rien trouvé.", 64, "Résultat"
End Sub