New
#1
How can I count the colour of cells with conditional formatting
Someone gave me a great routine to count the colour of cells in a range.But - that doesn't work if the colour is applied with conditional formatting. And I can't find a routine which does work for that. I thought it would be "DisplayFormat.Interior" but that doesn't work (for me).Code:Function CountCcolor(range_data As Range, criteria As Range) As Long Dim datax As Range Dim xcolor As Long xcolor = criteria.Interior.ColorIndex For Each datax In range_data If datax.Interior.ColorIndex = xcolor Then CountCcolor = CountCcolor + 1 End If Next datax End Function
Does anyone have any idea how I can get the colour count if the colour is applied with conditional formatting?
Thanks for any advice
This is for the latest Excel from Office 365. Running on WIndows 10 - latest updates.
Alan