Accueil Index Excel Fonctions Excel VBA Excel Forum
Fonctions personnalisées
|
Solution |
Explication |
||
|
Divers |
|||
|
Faire des sommes par couleur de fond |
|||
|
Fonction qui additionne les lettres des cellules d'une zone. |
|||
Télécharger un Fichier illustrant le fonctionnement de cette fonction (et d'autres fonctions):
Function Sum_Color(Data As Range, Critère As Range)
'Fonction qui additionne en fonction de la couleur de fond
Dim Ref_Color As Variant
Dim Cell As Variant
Ref_Color = Critère.Interior.ColorIndex
Sum_Color = 0
For Each Cell In Data
If Cell.Interior.ColorIndex = Ref_Color Then
Sum_Color = Sum_Color + Cell.Value
End If
Next Cell
End Function
Télécharger un Fichier illustrant le fonctionnement de cette fonction (et d'autres fonctions):
Function Sum_Text(Zone As Range)
'Fonction qui additionne toutes les lettres d'une zones
Dim Cell As Range
Sum_Text = ""
For Each Cell In Zone
Sum_Text = Sum_Text & Cell.Value
Next Cell
End Function