View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Finding cells based on the colour of the text

Jacob Cooke-TIlley wrote:

Posting this one as Im not sure how to approach it. My sheet is broken
up in production facilities as the heading and product lines (Multiple
in each location). When I run it off the main company system It makes
the production lines with faults go red, but there are two thousand of
them and only 20-30 of them are listed in red text. Is there anyway I
can Query or create a filter which just shows the ones with red text?


Recent versions of Excel can filter by color. Add a filter, then filter by
color.

If you can't, for whatever reason, you can use VBA to hide the rows that are
black, using the cells' .Font.Color property:

Sub findRed()
Const col = 1
Const start = 2
Dim ro As Long
For ro = start To start + 2000
If Cells(ro, col).Font.Color = vbBlack Then
Cells(ro, col).EntireRow.Hidden = True
End If
Next ro
End Sub

Change "col" to the column number of the first cell (e.g. 1 instead of A),
"start" to the number of the first row, and (optionally) "start + 2000" to
the number of the last row.

--
If you're good at something, never do it for free.