View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default Using function to change a cell color

version 2003
Conditional formatting wont work (i think). As the formatting depends on two
values (one constant = DayAverage and one variable = Difference in days).
Each day a record would be added.

"Bernard Liengme" wrote:

Functions can do one thing and one thing only: return a value to their own
cell (or cells in the case of array formulas)
They cannot do any formatting.

Have you thought of using conditional formatting? Try Help and then come
back with questions (what version of Excel are you using?)
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Tom" wrote in message
...
Hi,

This is what I am doing.
I have 4 variables: StartDate,CurrentDate,CurrentValue,DayAverage
I am passing these four variables into an excel function.

What I want to do is that if the difference between CurrentDate and
StartDate
is greater than 30 (1 month) and CurrentValue<DayAverage then the cell
from
where I called this function should turn "RED". If the difference is less
than 30 and CurrentValue<DayAverage then the cell should turn "YELLOW".


Changing color from within Function doesnt seem to work. Help!!

Thanks,
Sherry