Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"red5 " wrote in message
... I am using office 2000 and tring to write a function in which the argument is multiplied by 12. If the result is less than 36 I would like the answer to be highlited in a red cell. If it is greater that or equal to 36 it will remain a white cell. What I have written gives me the numerical answer but does not change the color of the box. This is what I have. Thank you for your help Mike Public Function mult(a As Single) As Single mult = a * 12 If 36 mult Then ActiveCell.Interior.ColorIndex = 3 Else ActiveCell.Interior.ColorIndex = 2 End If End Function I don't think you can be sure that the activecell is the cell with the formula in. The function would be called everytime that cell has to re-calculate, but the activecell would not move around during that process I think. Why not just use conditional formatting on the cell outide of VBA? Alan. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing the color of a cell based on the color of another cell. | Excel Discussion (Misc queries) | |||
Changing Cell Color | Excel Discussion (Misc queries) | |||
Color changing of fonts by using the IF function | Excel Worksheet Functions | |||
Changing cell color | Excel Programming | |||
Changing a cell color.... | Excel Programming |