Tags: cells, colour, condition, conditional, conditionalformat, excel, format, interior, microsoft, msdn, software, theconditional, value

the value of a condition in a conditional format

On Microsoft » Microsoft Excel

2,598 words with 2 Comments; publish: Fri, 30 May 2008 20:48:00 GMT; (306125.00, « »)

I use a conditional format to change the interior colour of cells. the

conditional is the same for all the cells to which the conditional

format refers. I'd like to know the displayed colour of a cell to

which the conditional format is applied, from VBA code. the

"background" colour of the cell is available as

<cell>.interior.colorindex

the conditional format color is available as

<cell>.<conditionalformat(1)>.interior.colorinde x

but the displayed colour depends on whether

<cell>.<conditionalformat(1)>.formula1

is true or false.

I'd rather not have to write an interpreter for what could be a

general expression.

thanks,

Eric

All Comments

Leave a comment...

  • 2 Comments
    • Not simple, but see http://www.xldynamic.com/source/xld.CFConditions.html

      --

      HTH

      Bob

      (there's no email, no snail mail, but somewhere should be gmail in my addy)

      <sizex0.excel.todaysummary.com.gmail.com> wrote in message

      news:31e42b85-86db-490b-a714-d418398be0ff.excel.todaysummary.com.l1g2000hsa.googlegroups.com...

      >I use a conditional format to change the interior colour of cells. the

      > conditional is the same for all the cells to which the conditional

      > format refers. I'd like to know the displayed colour of a cell to

      > which the conditional format is applied, from VBA code. the

      > "background" colour of the cell is available as

      > <cell>.interior.colorindex

      > the conditional format color is available as

      > <cell>.<conditionalformat(1)>.interior.colorinde x

      > but the displayed colour depends on whether

      > <cell>.<conditionalformat(1)>.formula1

      > is true or false.

      > I'd rather not have to write an interpreter for what could be a

      > general expression.

      > thanks,

      > Eric

      #1; Fri, 30 May 2008 20:50:00 GMT
    • Bob!

      thanks. I found that I could just run through the cells selecting them

      ...

      Cells(i, j).Select

      ' because I use European separators...

      formatCond =

      Application.Substitute(Selection.FormatConditions( 1).Formula1, ";",

      ",")

      If Selection.Parent.Evaluate(formatCond) Then

      ...

      to get the right relative positioning for the evaluation of formula1.

      Eric

      On 9 Jan, 16:17, "Bob Phillips" <bob....excel.todaysummary.com.somewhere.com> wrote:

      > Not simple, but seehttp://www.xldynamic.com/source/xld.CFConditions.html

      > --

      > --

      > HTH

      > Bob

      #2; Fri, 30 May 2008 20:51:00 GMT