• Finding cells based on the colour of the text

    From Jacob Cooke-TIlley@21:1/5 to All on Mon Jul 20 03:48:20 2020
    Hi Crew

    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Auric__@21:1/5 to Jacob Cooke-TIlley on Mon Jul 20 20:03:03 2020
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)