View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bernard Liengme[_3_] Bernard Liengme[_3_] is offline
external usenet poster
 
Posts: 1,104
Default Using function to change a cell color

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