Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I was working on a function that calculates the average
value of a range of cells. If the average amounts to zero, I want to change either the cell background to a particular color to alert users. I tried this in VBA: If Occupancy = 0 Then ActiveCell.Interior.Color= RGB(255, 0, 0) End If Where Occupancy is the name of the function. However this doesn't work as expected and the cell's color remains unchanged. Yet the same command works perfectly through the immediate window. Can anyone explain why it doesn't work and how to rectify it? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
coloring cells | New Users to Excel | |||
coloring cells | Excel Discussion (Misc queries) | |||
COLORING IN CELLS | Excel Discussion (Misc queries) | |||
Coloring certain cells | Excel Worksheet Functions | |||
Coloring Cells | Excel Worksheet Functions |