Function NiveauParSuppléance(niv As Integer, champ As Range, couleurfond As Range)
Application.Volatile
Dim c, temp
temp = 0
niv1 = 0
niv2 = 0
niv3 = 0
cf = couleurfond.Interior.Color
For Each c In champ
If c.Interior.Color <> cf And c = 1 Then niv1 = niv1 + 1
If c.Interior.Color <> cf And c = 2 Then niv2 = niv2 + 1
If c.Interior.Color <> cf And c = 3 Then niv3 = niv3 + 1
Next c
Select Case niv
Case 1
NiveauParSuppléance = niv1
Case 2
NiveauParSuppléance = niv2
Case 3
NiveauParSuppléance = niv3
End Select
End Function