Sub Conges(ByVal initiales As String, ByVal causes As String)
Dim Datemin As Date
Dim Datemax As Date
Dim D As Date
Dim C As Range
Dim l As Long
l = [A65535].End(xlUp).Row
For Each C In Range("B2:B" & l)
If C.Value = initiales Then
If C.Offset(0, 2) = causes Then
D = C.Offset(0, 4)
Debug.Print D
If Datemin = "00:00:00" Then Datemin = D
If Datemax = "00:00:00" Then Datemax = D
If D < Datemin Then Datemin = D
If D > Datemax Then Datemax = D
End If
End If
Next C
MsgBox initiales & ": absence du " & Datemin & " au " & Datemax
End Sub
Sub afficheconges()
Call Conges("MNS", "Arr.Mal")
End Sub