Sub macrol()
'Mise en place des données
Dim i As Integer
Dim a As Integer
Dim Moyenne As String
Dim MaSomme As Single
Dim MaPlage As Range
Dim Nombre As Single
'Calcul
i = 1
a = 3 'Colonne
MaSomme = 0
Nombre = 0
Cells(a, 1).Select
Do While (Cells(a, 1).Value <> 0)
If Cells(a, 1) = Cells(a + i, 1) Then
Cells(a, 13) = 0
i = i + 1
'a = a + 1
Else
'Cells(a, 13).Select
Range(Cells(a, 1), Cells(a + i - 1, 1)).Select
Nombre = Selection.Rows.count
'MaPlage = Range(Cells(a, 12), Cells(a + i, 12))
Range(Cells(a, 12), Cells(a + i - 1, 12)).Select
MaSomme = Application.WorksheetFunction.Sum(Selection)
Cells(a, 15) = Nombre
Cells(a + i - 1, 13) = (MaSomme) / (Nombre)
a = a + i
i = 1
End If
Loop
Range("L2").Select
End Sub