Code :
- For c = 0 To 23
- Moyenne = 0
- somme = 0
- NbRevision = 0
- For a = 2 To j
- If Mid(Cells(a, 3), 1, 2) = 18 And Cells(a, 2) = c Then
- NbRevision = NbRevision + 1
- somme = Cells(a, 7).Value + somme
- Sheets("synthese" ).Cells((c + 2), 4).Value = NbRevision
- Sheets("synthese" ).Cells((c + 2), 5).Value = somme
- Sheets("synthese" ).Cells((c + 2), 4).Interior.Color = vbYellow
- Sheets("synthese" ).Cells((c + 2), 4).Borders.Value = 1
- Sheets("synthese" ).Cells((c + 2), 5).Interior.Color = vbYellow
- Sheets("synthese" ).Cells((c + 2), 5).Borders.Value = 1
- End If
- Next a
- If NbRevision > 0 Then
- Moyenne = somme / NbRevision
- Sheets("synthese" ).Cells((c + 2), 6).Value = Moyenne
- Sheets("synthese" ).Cells((c + 2), 6).Interior.Color = vbYellow
- Sheets("synthese" ).Cells((c + 2), 6).Borders.Value = 1
- End If
- Next c
|