Re,
chlillo a écrit :
Petite question que signifie le 2 dans la formule''fond2''
Dans le module VBA tu as 2 fonctions.
Function CompteCouleurFond(champ As Range, couleurfond)
Application.Volatile
Dim c, temp
temp = 0
For Each c In champ
If c.Interior.ColorIndex = couleurfond Then
temp = temp + 1
End If
Next c
CompteCouleurFond = temp
End Function
Function CompteCouleurFond2(champ As Range, couleurfond As Range)
Application.Volatile
Dim c, temp
temp = 0
cf = couleurfond.Interior.Color
For Each c In champ
If c.Interior.Color = cf Then
temp = temp + 1
End If
Next c
CompteCouleurFond2 = temp
End Function
La formule fait appel à la 2ème.
Tu peux virer la 1er.
.