View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Conditionally Formatting a Cell

On 29 Sep 2005 11:03:17 -0700, "Floyd" wrote:

All:

I am attempting to use either a user-defined function in VBA or a
spreadsheet function to conditonally shade a cell.

I would use Excel's conditional formatting; however, it is limited to
three conditions.

Also, I can do this with VBA. Unfortunately, then I would have to
re-refernce the subroutine when the data is moved. Given the dynamics
of this spreadsheet, I would be required to do this often.

Is there anyway to use something like this,IF(A1=1, ColorIndex=1, "") ,
to conditionally format a cell?

Thanks in advance.

Floyd


A formula cannot change the formatting of a cell. This rule is true both for
worksheet functions, and for VBA UDF's, even if they reference a macro.

If a cell is copy/pasted, the formatting would move with it, so I guess I don't
understand your objection to a VBA Sub.


--ron