Can we change cell color programatically?

M

Mike

Hi all

I'm using Excel 2003.
Does Excel allow me to change the fill-color of a cell based upon the
contents of that cell?

For example: If the formula of a cell calculates its value to be less then,
say, 100, I'd like to fill-color that cell to Green. Otherwise I'd like to
color that cell with no color.

Is this possible?

Thanks

-Mike
 
D

Dave Peterson

Take a look at Format|Conditional formatting.

You can specify up to 3 rules (and formats) as well as the "normal" format.
 
J

Jim Rech

Check out Conditional Formatting on the Format menu.

--
Jim
| Hi all
|
| I'm using Excel 2003.
| Does Excel allow me to change the fill-color of a cell based upon the
| contents of that cell?
|
| For example: If the formula of a cell calculates its value to be less
then,
| say, 100, I'd like to fill-color that cell to Green. Otherwise I'd like to
| color that cell with no color.
|
| Is this possible?
|
| Thanks
|
| -Mike
 
M

Mike

Thanks Dave and Jim for your help. :)

This almost seems to work. It allows me to do what I want if I hard-code a
specific value into the conditional formatting setup.
However, it does not seem to allow me to specify that the conditional format
should be based off of the value within a particular cell, which is what I'd
really like for it to do.

For example. I've specified cell E5 to contain a value of 145. If I then
specify in the conditional format: "Cell Value Is greater than or equal to
145" Excel behaves how I want.
However, Excel does not seem to allow me to reference cell E5 (instead of
the hard-coded number 145) in the conditional formatting.

Is there some what to specify a particular cell reference in the conditional
formatting?

Thanks again :)

-Mike
 
M

Mike

Ooops. Just figured it out.

Silly me...

I just needed to supply =$E$5 for the condition and it all works great.

Thanks so much for your help. :)

-Mike
 
J

Jim Rech

Change the drop down on the left of the Conditional Formatting dialog to
"Formula is". Now if you wanted the active cell to change format when E5 is
145 the formula you enter is =E5=145.

Think of the formula you enter as a true/false. If it evaluates to True you
get the format, else you don't.

--
Jim
| Thanks Dave and Jim for your help. :)
|
| This almost seems to work. It allows me to do what I want if I hard-code a
| specific value into the conditional formatting setup.
| However, it does not seem to allow me to specify that the conditional
format
| should be based off of the value within a particular cell, which is what
I'd
| really like for it to do.
|
| For example. I've specified cell E5 to contain a value of 145. If I then
| specify in the conditional format: "Cell Value Is greater than or equal to
| 145" Excel behaves how I want.
| However, Excel does not seem to allow me to reference cell E5 (instead of
| the hard-coded number 145) in the conditional formatting.
|
| Is there some what to specify a particular cell reference in the
conditional
| formatting?
|
| Thanks again :)
|
| -Mike
|
| "Jim Rech" wrote:
|
| > Check out Conditional Formatting on the Format menu.
| >
| > --
| > Jim
| > | > | Hi all
| > |
| > | I'm using Excel 2003.
| > | Does Excel allow me to change the fill-color of a cell based upon the
| > | contents of that cell?
| > |
| > | For example: If the formula of a cell calculates its value to be less
| > then,
| > | say, 100, I'd like to fill-color that cell to Green. Otherwise I'd
like to
| > | color that cell with no color.
| > |
| > | Is this possible?
| > |
| > | Thanks
| > |
| > | -Mike
| >
| >
| >
 

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