+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatted Cell Color Index

  1. #1
    MDR5300
    Guest

    Conditional Formatted Cell Color Index

    I need a little help in how to determine the color index of a cell that is
    formatted with ondition formatting.

    The spreadsheet formats the color of the cells to RED, Yellow, Or Green with
    conditional formatting and I need to be able to count the number of Cells in
    a range that are green. The cells interior color index properity does not
    give me the color value when conditional formatting is used.

    Im using EXCEL 2002 SP3

  2. #2
    Bob Phillips
    Guest

    Re: Conditional Formatted Cell Color Index

    Not easy, but Chip has a function at his site
    http://www.cpearson.com/excel/CFColors.htm

    IMO, it is better to count the conditions that force the colour. SO for
    instance, if the cells are green if the value is > 10 then use

    =COUNTIF(A1:A100,">10")

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "MDR5300" <[email protected]> wrote in message
    news:[email protected]...
    > I need a little help in how to determine the color index of a cell that is
    > formatted with ondition formatting.
    >
    > The spreadsheet formats the color of the cells to RED, Yellow, Or Green

    with
    > conditional formatting and I need to be able to count the number of Cells

    in
    > a range that are green. The cells interior color index properity does not
    > give me the color value when conditional formatting is used.
    >
    > Im using EXCEL 2002 SP3




  3. #3
    ben
    Guest

    RE: Conditional Formatted Cell Color Index

    if you are writing a maco, instead of checking for interior color, you could
    check for the conditions you use to format. eg if a cell value of 4 -
    10 = green interior
    then search for cells with a cell value of 4 - 10 and that = your amount of
    green cells

    "MDR5300" wrote:

    > I need a little help in how to determine the color index of a cell that is
    > formatted with ondition formatting.
    >
    > The spreadsheet formats the color of the cells to RED, Yellow, Or Green with
    > conditional formatting and I need to be able to count the number of Cells in
    > a range that are green. The cells interior color index properity does not
    > give me the color value when conditional formatting is used.
    >
    > Im using EXCEL 2002 SP3


  4. #4
    Gys
    Guest

    Re: Conditional Formatted Cell Color Index

    Hi,
    this function returns the color code of a cell

    Function CellColorCode(MyCell As Range) As Single
    '
    'Gys Nov-2004
    'Function produces the Color Code of a Cell
    'A Pivot Table can be used to count colored Cells
    '
    CellColorCode = MyCell.Interior.ColorIndex
    '
    End Function



    "MDR5300" <[email protected]> wrote in message
    news:[email protected]...
    > I need a little help in how to determine the color index of a cell that is
    > formatted with ondition formatting.
    >
    > The spreadsheet formats the color of the cells to RED, Yellow, Or Green

    with
    > conditional formatting and I need to be able to count the number of Cells

    in
    > a range that are green. The cells interior color index properity does not
    > give me the color value when conditional formatting is used.
    >
    > Im using EXCEL 2002 SP3




  5. #5
    Bob Phillips
    Guest

    Re: Conditional Formatted Cell Color Index

    The OPs cells are coloured by conditional formatting. This routine will not
    determine that colour, as the OP says, the ColorIndex property is not set by
    CF.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Gys" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    > this function returns the color code of a cell
    >
    > Function CellColorCode(MyCell As Range) As Single
    > '
    > 'Gys Nov-2004
    > 'Function produces the Color Code of a Cell
    > 'A Pivot Table can be used to count colored Cells
    > '
    > CellColorCode = MyCell.Interior.ColorIndex
    > '
    > End Function
    >
    >
    >
    > "MDR5300" <[email protected]> wrote in message
    > news:[email protected]...
    > > I need a little help in how to determine the color index of a cell that

    is
    > > formatted with ondition formatting.
    > >
    > > The spreadsheet formats the color of the cells to RED, Yellow, Or Green

    > with
    > > conditional formatting and I need to be able to count the number of

    Cells
    > in
    > > a range that are green. The cells interior color index properity does

    not
    > > give me the color value when conditional formatting is used.
    > >
    > > Im using EXCEL 2002 SP3

    >
    >




  6. #6
    GysdeJongh
    Guest

    Re: Conditional Formatted Cell Color Index

    Sorry , my fault , I missed that
    Gys

    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > The OPs cells are coloured by conditional formatting. This routine will not
    > determine that colour, as the OP says, the ColorIndex property is not set by
    > CF.
    >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1