Claudy
XLDnaute Accro
Bonjour à tous,
dans un gros tableau Organique, j'utilise la fonction SommeCouleurFond....(Voir ci dessous)
La formule affiche bien la bonne somme...mais quelques instant après, #VALEUR! s'affiche.
Avez vous une explication?
merci d'avance,
Claudy
Function SommeCouleurFond(PlageSomme As Range, PlageCouleur As Range) As Variant
'*********************************************************
' Effectuer la somme des cellules en couleur *
'*********************************************************
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
dans un gros tableau Organique, j'utilise la fonction SommeCouleurFond....(Voir ci dessous)
La formule affiche bien la bonne somme...mais quelques instant après, #VALEUR! s'affiche.
Avez vous une explication?
merci d'avance,
Claudy
Function SommeCouleurFond(PlageSomme As Range, PlageCouleur As Range) As Variant
'*********************************************************
' Effectuer la somme des cellules en couleur *
'*********************************************************
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