SUMIF COLOR
Solved
Amesam
Posted messages
18
Registration date
Status
Membre
Last intervention
-
Amesam Posted messages 18 Registration date Status Membre Last intervention -
Amesam Posted messages 18 Registration date Status Membre Last intervention -
Hello,
I’m stuck with a binder, a 2018 schedule.
I’m using this function:
For three years I’ve been using this function without issues, but now I can’t find why it’s not working.
I saved my file as .xlsm but same issue!
If anyone has any ideas, thanks for the feedback.
I’m stuck with a binder, a 2018 schedule.
I’m using this function:
Function SOMME_SI_COULEUR(PlageSomme As Range, PlageCouleur As Range) As Variant
'*********************************************************
' Sum the colored cells *
'*********************************************************
Dim Cel As Range
Dim Som As Double
If PlageCouleur.Cells.Count > 1 Then
SOMME_SI_COULEUR = CVErr(xlErrValue)
Exit Function
End If
For Each Cel In PlageSomme
If Cel.Interior.ColorIndex = PlageCouleur.Interior.ColorIndex Then Som = Som + Cel
Next
SOMME_SI_COULEUR = Som
End Function
For three years I’ve been using this function without issues, but now I can’t find why it’s not working.
I saved my file as .xlsm but same issue!
If anyone has any ideas, thanks for the feedback.


During a check, shouldn't we rather use "IF(a==b)" instead of "IF(a=b)"?
Isn't your range B14:AF14 derived from conditional formatting? Because if that's the case, the function
won't work.
I think you should attach your file to check all of this.
@+