Function NCoul(ref As Range, r As Range, titre, zonetitre As Range, sens As Byte)
'sens=0 lignes, sens=1 colonnes
Application.Volatile
Dim coul&
With zonetitre(Application.Match(titre, zonetitre, 0)).MergeArea
Set r = Intersect(r, IIf(sens, .EntireColumn, .EntireRow))
End With
coul = ref.Interior.Color
For Each r In r
If r.Interior.Color = coul Then NCoul = NCoul + 1
Next
End Function