Sub compte()
Dim bleu%, vert%, S%, D%, CP%
Application.Goto Sheets('feuil1').Range('E44')
For p = 6 To 10
With Sheets('juin2006')
For k = 24 To 44
If .Cells(p, k).Interior.ColorIndex = 41 Or .Cells(p, k).Interior.ColorIndex = 6 Then
bleu = bleu + 1
ElseIf .Cells(p, k).Interior.ColorIndex = 4 Then
vert = vert + 1
ElseIf .Cells(5, k).Value = 'S' Then
S = S + 1
ElseIf .Cells(5, k).Value = 'D' Then
D = D + 1
ElseIf .Cells(5, k).Value = 'CP' Then
CP = CP + 1
End If
Next k
End With
With Sheets('juin2006')
For k = 10 To 16
If .Cells(p, k).Interior.ColorIndex = 41 Or .Cells(p, k).Interior.ColorIndex = 6 Then
bleu = bleu + 1
ElseIf .Cells(p, k).Interior.ColorIndex = 4 Then
vert = vert + 1
ElseIf .Cells(5, k).Value = 'S' Then
S = S + 1
ElseIf .Cells(5, k).Value = 'D' Then
D = D + 1
ElseIf .Cells(5, k).Value = 'CP' Then
CP = CP + 1
End If
Next k
End With
Cells(38 + p + x, 5).Value = bleu
bleu = 0
Cells(38 + p + x, 6).Value = vert
vert = 0
Cells(38 + p + x, 7).Value = S
S = 0
Cells(38 + p + x, 8).Value = D
D = 0
Cells(38 + p + x, 9).Value = CP
CP = 0
x = x + 1
Next p
End Sub