View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default How to do a function that alters the format of the cell when it is applied?

faustino

Functions cannot alter formats, only return results to the cell they are in.

Try......FormatConditional FormattingCell Value is: less than 0

FormatPatternsselect color then OK your way out.

Gord Dibben Excel MVP

On Wed, 18 Feb 2004 19:08:46 -0600, "faustino Dina"
wrote:

Hi,

I need to do a function that alters the format of the cell in which it is
applied. For example, suppose it is a function f() that returns a number. I
need if this number is < 0 the result in the cell will be displayed red,
else in black. How can I do that?
Any idea is welcomed

Thanks in advance