Archive of Mr Excel Message Board

Back to Forms in Excel VBA archive index
Back to archive home

Coloring text (or background) depending on value in cell
Posted by Geoff on March 04, 2001 1:11 PM
If the cell value is greater than say 20 I want to highlight the cell in some way. Either by changing the font color, the cell background color or even the font style. Can I do this as a user defined function such as
function blue(b)
if b>20
fontcolor?????=blue????
else
fontcolor?????=green???
endif
If so what are the correct words. If not does anyone know a way of doing it?
Many thanks.
Geoff

Re: Coloring text (or background) depending on value in cell
Posted by Aladin Akyurek on March 04, 2001 1:42 PM
Would Conditional Formatting not do the job?

Re: Coloring text (or background) depending on value in cell
Posted by Roger Redhat on March 04, 2001 1:44 PM
Geoff,
Why don't you use Conditional Formatting?
Regards,
Roger.

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.