YasserKhalil
07-30-2010, 02:34 AM
Hi guys
I got a UDF Function which counts the colored cells
It works fine
But when I try to color a cell within the range, Excel doesn't recalculate the colored cells until I clicked twice in the cell that has the function
I want a solution to get the result as soon as I color another cell within the range..
Function CountColors(myrng As Range)
Dim Cell As Range
For Each Cell In myrng
If Cell.Interior.ColorIndex <> xlNone Then
CountColors = CountColors + 1
End If
Next
End Function
I got a UDF Function which counts the colored cells
It works fine
But when I try to color a cell within the range, Excel doesn't recalculate the colored cells until I clicked twice in the cell that has the function
I want a solution to get the result as soon as I color another cell within the range..
Function CountColors(myrng As Range)
Dim Cell As Range
For Each Cell In myrng
If Cell.Interior.ColorIndex <> xlNone Then
CountColors = CountColors + 1
End If
Next
End Function