De: Hans Kamp Objet: Re: cond format Date : mercredi 13 septembre 2000 09:45 "Michael Mueller" schreef in bericht news:8pn3de$pb6$1@proxy.fe.internet.bosch.de... > Hi again, > > If you got a particular number which indicates the color, don't search for > the color itself, better search for the number! You can test, though, whether a cell has a conditional format or not. I have written a function that counts the number of cells in a range thas has a conditional format: Function CountCond(b As Range) res = 0 For Each c In b If c.FormatConditions.Count > 0 Then res = res + 1 End If Next c CountCond = res End Function It also counts the cells, whether the conditions for conditional formatting are not met. If you want the macro to count the cells that meet the conditional formatting, use the function: Function CountCondMet(b As Range) Dim NumVal As Variant Dim StrVal As Variant res = 0 For Each c In b If c.FormatConditions.Count > 0 Then If c.Value = Val(c.FormatConditions(1).Formula1) Then res = res + 1 End If End If Next c CountCondMet = res End Function I am asuming that c.FormatConditions(1).Formula1 is just a number. This function needs more perfection, though. -- Hans Kamp (Win2000) info@hanskamp.com www.hanskamp.com