Somme des cellules d'un champ ayant la couleur de texte spécifiée
Dans un module (Alt+F11 puis Insertion/Module)
Function SommeCouleurTexte(champ As Range, couleurTexte)
Application.Volatile
Dim c, temp
temp = 0
For Each c In champ
If c.Font.ColorIndex = couleurTexte Then
If IsNumeric(c.Value) Then temp = temp + c.Value
End If
Next c
SommeCouleurTexte = temp
End Function
Pour maj touche F9 ou maj immédiate:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Calculate
End Sub
Fonction SommeCouleurTexte.xls