Bonjour,
Voici mon soucis, lorsque j'utilise la fonction bien connue CompteCouleurFond2(), en mettant dans la partie "Range" un lien vers un autre fichier excel, j'obtiens un joli #VALEUR# lorsque fichier_tableau.xls est fermé.
petit exemple:
Dans la case A1 je mets la cellule en Rouge
Dans la case A2 je mets =CompteCouleurFond2('[fichier_tableau.xls]feuil1'!$I$13:$R$200;A1)
Pour mémo le code de la fonction:
Function CompteCouleurFond2(champ As Range, couleurfond As Range)
Application.Volatile
Dim c, temp
temp = 0
cf = couleurfond.Interior.Color
For Each c In champ
If c.Interior.Color = cf Then
temp = temp + 1
End If
Next c
CompteCouleurFond2 = temp
End Function
Merci.
Voici mon soucis, lorsque j'utilise la fonction bien connue CompteCouleurFond2(), en mettant dans la partie "Range" un lien vers un autre fichier excel, j'obtiens un joli #VALEUR# lorsque fichier_tableau.xls est fermé.
petit exemple:
Dans la case A1 je mets la cellule en Rouge
Dans la case A2 je mets =CompteCouleurFond2('[fichier_tableau.xls]feuil1'!$I$13:$R$200;A1)
Pour mémo le code de la fonction:
Function CompteCouleurFond2(champ As Range, couleurfond As Range)
Application.Volatile
Dim c, temp
temp = 0
cf = couleurfond.Interior.Color
For Each c In champ
If c.Interior.Color = cf Then
temp = temp + 1
End If
Next c
CompteCouleurFond2 = temp
End Function
Merci.