This project has moved. For the latest updates, please go here.

Filter on Text Color

Aug 9, 2016 at 6:54 PM
Hi,

It's been a while since I had a question, but this may be something others could use. I have some PDFs converted to Excel workbooks. Some of the text is in red or yellow to indicate a change from the last version. Is it possible to use ClosedXML to set an AutoFilter, to filter on just those rows? I have done this manually, but I don't see examples where filtering is set on Font Color using ClosedXML. Is there any way to determine if a font color (red) occurs in a range, or on a sheet? Is it possible to set a custom auto filter and apply it to the column to see if there are any matching rows?

Thanks.

Steve
Aug 10, 2016 at 1:37 PM
Also, I have this working:
        if (row.Cell(2).Style.Font.FontColor == XLColor.Red)
        {
            //do some stuff
        }
However, some of the text is black, and part of it is red- that does not seem to get matched. AutoFilter on Text Color will pick up partial matching in a cell; I just need to have a ClosedXML way to do it.

Thanks