Can you change the color of a cell?

T

Timothy Wright

Hi. If I have a column of numbers which are blue in color, but some
of the cells don't meet a certain criteria can I then have those cells
become another color? Can I do this without using a macro?

For example:

33
36
22
16
235
0
0
0
0

All of the numbers greater than zero are blue, but I would like to
have all cells with a zero turn black. The numbers are there of
course because of some formulas happening elsewhere.

Thanks,

Timothy
 
D

David McRitchie

Hi Timothy, (summary of your choices)
You can do this with normal cell formatting, which is
your best choice -- works for numbers (constants and formulas),
you can use one other color for text (onstants and formulas)..

How are currently getting blue. Conditional cell
formatting overrides normal cell formatting.

Normal Cell Formatting:
You can choose a format close to what you want
then modify it under custom.
Format, Cells, Number (tab), Custom
[Blue]General;[Red]-General;General

Note separation by semi-colon (US regional list separator)
postive numbers; negative numbers; zero; text

more information in
http://www.mvps.org/dmcritchie/excel/formula.htm#cellformat
http://support.microsoft.com/default.aspx?scid=/support/Excel/Content/Formats/default.asp#number

Conditional Formatting:
Conditional Formatting can be use for more complicated
situations and if the condition applies it overrides normal
cell formatting. You can extent the previous example
to color cells equal to or greater than 2,000 with a 4th color
with Conditional Formatting
(you are limited to 3 C.F. formulas, per cell)
http://www.mvps.org/dmcritchie/excel/condfmt.htm

With cell A1 active, and a selection of your choice for coloring,
format, Conditional Formatting.
Formula is: =A1>=2000

Event Macro:
If you cannot use Conditional Formatting because you
need more than 3 choices you have to move up to
an Event Macro, which are trickier in that you have to
have something to trigger the event. (Manual change, calculation,
worksheet selection, double-click, etc)
http://www.mvps.org/dmcritchie/excel/event.htm
 
G

Gord Dibben

Timothy

Select the cells in the column.

Format>Conditional Formatting>Cell Value is: equal to zero

Format to black.

Gord Dibben Excel MVP
 
Top