tout d' abord merci , pour la réponse, alors voici mon usine a gaz ( je débute en macro, alors bien évidemment, je ne suis pas le pere de cette oeuvre d' art, mais je la comprends un peu, lol )
Sub somme_couleur()
'initialisation du tableau
Range(Cells(3, 35), Cells(63, 51)) = ''
'tableau 3 à 33 en large
'tableau de 60 lignes de 3 à 63
For ligne = 3 To 63
'total cases colorees
total_bleuclair = 0
total_jaune = 0
total_rouge = 0
total_vertclair = 0
total_rose = 0
total_grisclair = 0
total_marron = 0
total_orange = 0
'nombre cases colorées
roses = 0
rouges = 0
jaunes = 0
oranges = 0
bleuclairs = 0
marrons = 0
vertclairs = 0
grisclairs = 0
For Each VALEUR In Range(Cells(ligne, 3), Cells(ligne, 33))
If VALEUR.Interior.ColorIndex = 3 Then
total_rouge = total_rouge + VALEUR.Value
rouges = rouges + 1
End If
If VALEUR.Interior.ColorIndex = 4 Then
total_vertclair = total_vertclair + VALEUR.Value
vertclairs = vertclairs + 1
End If
If VALEUR.Interior.ColorIndex = 6 Then
total_jaune = total_jaune + VALEUR.Value
jaunes = jaunes + 1
End If
If VALEUR.Interior.ColorIndex = 7 Then
total_rose = total_rose + VALEUR.Value
roses = roses + 1
End If
If VALEUR.Interior.ColorIndex = 15 Then
total_grisclair = total_grisclair + VALEUR.Value
grisclair = grisclairs + 1
End If
If VALEUR.Interior.ColorIndex = 33 Then
total_bleuclair = total_bleuclair + VALEUR.Value
bleuclairs = bleuclairs + 1
End If
If VALEUR.Interior.ColorIndex = 53 Then
total_marron = total_marron + VALEUR.Value
marrons = marrons + 1
End If
If VALEUR.Interior.ColorIndex = 45 Then
total_orange = total_orange + VALEUR.Value
oranges = oranges + 1
End If
Next VALEUR
'affichage des valeurs enregistrées dans les bonnes cases de récapitulatifs
'les sommes :
If total_rose Then Cells(ligne, 35) = total_rose
If total_rouge Then Cells(ligne, 36) = total_rouge
If total_jaune Then Cells(ligne, 37) = total_jaune
If total_orange Then Cells(ligne, 38) = total_orange
If total_bleuclair Then Cells(ligne, 39) = total_bleuclair
If total_vertclair Then Cells(ligne, 40) = total_vertclair
If total_marron Then Cells(ligne, 41) = total_marron
If total_grisclair Then Cells(ligne, 42) = total_grisclair
'le nombres de cases :
If roses Then Cells(ligne, 44) = roses
If rouges Then Cells(ligne, 45) = rouges
If jaunes Then Cells(ligne, 46) = jaunes
If oranges Then Cells(ligne, 47) = oranges
If bleuclairs Then Cells(ligne, 48) = bleuclairs
If marrons Then Cells(ligne, 50) = marrons
If vertclairs Then Cells(ligne, 49) = vertclairs
If grisclairs Then Cells(ligne, 51) = grisclairs
Next ligne
End Sub
je le met ou (cel_ref) ? lol