I have an enormous range of data (10k rows x 10k columns) with conditional formatting applied to all cells in this range. The range is something like the below, which is a concatenate of the row and column header values:
I want to do a COUNTIF to see how many cells in each row have conditional formatting applied. The conditional formatting returns RGB(255, 204, 255) when the condition is met. The condition is a MATCH formula that looks at a separate tab to see if the concatenate value exists in that tab, so the COUNTIF would not be able to use the condition as a criteria. I was looking at using a custom formula in VBA:
But this only works for cells that explicitly have the color applied, rather than ones that have conditional formatting applied. What would I need to do to make this work? Thanks!
0001 | 0002 | 0003 | 0004 | 0005 | 0006 | |
---|---|---|---|---|---|---|
0001 | 00010001 | 00010002 | 00010003 | 00010004 | 00010005 | 00010006 |
0002 | 00020001 | 00020002 | 00020003 | 00020004 | 00020005 | 00020006 |
0003 | 00030001 | 00030002 | 00030003 | 00030004 | 00030005 | 00030006 |
0004 | 00040001 | 00040002 | 00040003 | 00040004 | 00040005 | 00040006 |
0005 | 00050001 | 00050002 | 00050003 | 00050004 | 00050005 | 00050006 |
0006 | 00060001 | 00060002 | 00060003 | 00060004 | 00060005 | 00060006 |
I want to do a COUNTIF to see how many cells in each row have conditional formatting applied. The conditional formatting returns RGB(255, 204, 255) when the condition is met. The condition is a MATCH formula that looks at a separate tab to see if the concatenate value exists in that tab, so the COUNTIF would not be able to use the condition as a criteria. I was looking at using a custom formula in VBA:
VBA Code:
Function COUNT_COLOR(RANGE As RANGE, COLOR As RANGE)
Dim COLORC As Integer
Dim COUNTT As Integer
COLORC = COLOR.Interior.ColorIndex
For Each IC In RANGE
If IC.Interior.ColorIndex = COLORC Then
COUNTT = COUNTT + 1
End If
Next IC
COUNT_COLOR = COUNTT
End Function
But this only works for cells that explicitly have the color applied, rather than ones that have conditional formatting applied. What would I need to do to make this work? Thanks!