Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a cell formula that can change the color of the cell based on its content

Conditional Cell Formatting

Is there a cell formula that can change the color of the cell based on its content

by  oscarse  Posted    (Edited  )
Not easily ... you could possibly write an Excel VBA function to do this ... BUT ... Excel 97 and above have a condition format capability that will automatically format a cell based on a set of user entered rules

By selecting a cell or group of cells, format rules, can be applied under FORMAT Conditional Formatting.

example:

setup a total column
highlight the column
select Conditional Formatting
Set the first rule as: greater then 0 with Pattern fill Green
Add a new rule and set to: Less then 0 with Pattern fill Red
Add a new rule and set to: equal 0 (don't change any formats)

now the column of cells will follow whatever value exists in the cells;
anything < 0 will turn the cell red
0 will be no color change
> 0 will be Green

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top