'Section -- 5 -- 'Moyenne par mois des temps de chacune des 3 personnes
Dim Frq()
Set Dest4 = Worksheets("Récap").Range("K65000").End(xlUp).Offset(1, 0)
Dest4.Resize(1, UBound(LesNoms) + 1) = LesNoms
ReDim T2(UBound(LesNoms))
ReDim Frq(UBound(LesNoms))
i = LBound(T1, 1)
ligne = 0
Do
début_période = Month(T1(i, 1))
T2(0) = 0: T2(1) = 0: T2(2) = 0: T2(3) = 0
Frq(1) = 0: Frq(2) = 0: Frq(3) = 0
Do While Month(T1(i, 1)) = début_période
Select Case T1(i, 2)
Case LesNoms(1)
T2(1) = T2(1) + T1(i, 3)
Frq(1) = Frq(1) + 1
Case LesNoms(2)
T2(2) = T2(2) + T1(i, 3)
Frq(2) = Frq(2) + 1
Case LesNoms(3)
T2(3) = T2(3) + T1(i, 3)
Frq(3) = Frq(3) + 1
End Select
i = i + 1: If i > UBound(T1, 1) Then Exit Do
Loop
For j = 1 To UBound(LesNoms)
If Frq(j) > 0 Then T2(j) = T2(j) / Frq(j) Else T2(j) = "--"
Next j
ligne = ligne + 1
Dest4.Offset(ligne, 0).Resize(1, UBound(T2) + 1) = (T2)
Dest4.Offset(ligne, 0).Value = "mois " & début_période
Loop Until i > UBound(T1, 1)
Erase T2