conditional formatting question

G

Gary Keramidas

Debug.Print cell.Interior.ColoriIndex

does not return the color of a cell using conditional formatting. it
retunes -4142.

how do you return the cell colorindex of a conditionally formatted cell?
 
G

Gary Keramidas

ok, thanks, it's not that big of a deal, i'll work around it. just figured if a
cell had a background, it would be returned with colorindex.
 
B

Bob Phillips

No because the cell doesn't have that background, it is format. Just as a
cell with a format of 0.00 might show a value of 2.66, but really contain a
value of 2.67234. It is only presentation.

You could always check that the cell satisfies the condition stipulated in
the CF.

--

HTH

Bob Phillips

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

David McRitchie

Hi Gary,
a bit late, but since you sprecifically mentioned -4142 as a color
and I don't see any specific response to that ...

it is the value for xlColorIndexNone
which is NOT the same as white for interior
nor is it specifically black for text.

Since it is a default, programming might actually disregard the
value and work perfectly well.

See http://www.mvps.org/dmcritchie/excel/colors.htm#macros

since the topic was conditional formatting you may find other related
material not already mentioned in this thread or on Bob's page at
http://www.mvps.org/dmcritchie/excel/condfmt.htm
also possibly
http://www.mvps.org/dmcritchie/excel/xl2html.htm

since this is an old thread (1 1/2 weeks) the complete thread can be reviewed at
http://google.com/[email protected]
 

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