Orientationis
XLDnaute Junior
Bonjour,
Je voudrais compter toutes les cellules comportant une fond jaune.
Comment puis-je faire?
Je voudrais compter toutes les cellules comportant une fond jaune.
Comment puis-je faire?
Sub testcouleurJaune()
For Each cell In Selection
j = j + 1
If cell.Interior.ColorIndex = 36 Or _
cell.Interior.ColorIndex = 6 _
Then
i = i + 1
End If
Next
MsgBox i & " cellules jaunes sur " & j & "selectionnées"
End Sub
Function CelFondByColor(PlageEntree As Range)
Dim TempSum As Integer
Application.Volatile
MyColorIndex = 6
TempSum = 0
For Each Cell In PlageEntree
If Cell.Interior.ColorIndex = MyColorIndex Then TempSum = TempSum + 1
Next Cell
Set Cell = Nothing
CelFondByColor = TempSum
End Function