Mets cette macro dans un module standard ( la première ligne doit être en tête du module) :
Option Base 1
Sub test()
Dim Tabl As Variant, NP As Variant, DAT As Variant, Noms As Variant, Result()
Dim I As Long, J As Long, Txt As String
With Sheets("Absences collaborateurs")
Tabl = .Range("F3", .Cells(.Rows.Count, 6).End(xlUp)).Resize(, 3)
NP = .Range("C3", .Cells(.Rows.Count, 3).End(xlUp)).Resize(, 2)
End With
For I = 1 To UBound(Tabl, 1)
Tabl(I, 3) = NP(I, 2) & " " & NP(I, 1)
Next I
With Sheets("Liste des dépenses")
DAT = Application.Transpose(.Range("A8", .Cells(.Rows.Count, 1).End(xlUp)))
Noms = Application.Transpose(.Range("H8", .Cells(.Rows.Count, 8).End(xlUp)))
ReDim Result(UBound(DAT))
For I = 1 To UBound(Tabl, 1)
For J = 1 To UBound(Noms)
If UCase(Tabl(I, 3)) = UCase(Noms(J)) Then
If CDate(DAT(J)) >= Tabl(I, 1) Then
If CDate(DAT(J)) <= Tabl(I, 2) Then
Txt = "Début : " & Format(Tabl(I, 1), "dd/mm/yyyy") & " Fin : " & _
Format(Tabl(I, 2), "dd/mm/yyyy")
Result(J) = Txt
End If
End If
End If
Next J
Next I
.[W8] = Application.Transpose(Result)
End With
End Sub
Si tu as un problème avec les macros, dis-le.
Daniel