1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| Sub tableau()
Dim i, j, deb, fin, x As Integer
Dim Mtt(10), somme As Long
deb = 0
fin = 0
x = 0
i = 1
j = 0
somme = 0
Do
While deb = 0 Or fin = 0
If (Sheets("Suivi").Cells(i, 8).Interior.Color = 16711422) Then
If deb = 0 Then
deb = i + 1
Else
fin = i - 1
End If
End If
i = i + 1
Wend
For j = deb To fin
somme = somme + Cells(j, 10)
Next
Mtt(x) = somme
x = x + 1
deb = 0
fin = 0
somme = 0
i = i - 1
Loop Until Sheets("Suivi").Cells(i, 8).Font.Color = 1
j = 6
For i = 0 To x
If Cells(j, 8).Interior.Color = 16711422 Then
Cells(j, 8) = Mtt(i)
End If
Next
End Sub |
Partager