the value of a condition in a conditional format

S

sizex0

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.colorindex
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
 
S

sizex

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top