Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Conditional Formatting
I am using a VB code for the worksheet to change cell color if a certain
number is entered. Private Sub Worksheet_Change(ByVal Target As RANGE) Dim icolor As Integer If Not Intersect(Target, RANGE("D12:D26")) Is Nothing Then Select Case Target Case 0.09 To 0.869 icolor = 3 'RED' Case 0.87 To 0.899 icolor = 36 'Light Yellow' Case 0.9 To 0.939 icolor = 35 'Light Green' Case 0.94 To 0.969 icolor = 37 'Pale Blue' Case 0.97 To 1 icolor = 44 'Gold' End Select Target.Interior.ColorIndex = icolor End If I am taking an average of the range above. In Cell D28 I have this formula: =IF(ISERROR(AVERAGE(D12:D26)),0,(AVERAGE(D12:D26)) ) Now I would like for this cell to change color according to the average similar to the VB code for the worksheet, such as if the average is .09 to ..869, then the cell color would be €˜RED, etc. Right now all I get is the value, not the color also. Can anyone help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional Formatting when inserting a row | Excel Worksheet Functions | |||
Conditional Formatting Error | Excel Worksheet Functions | |||
difficulty with conditional formatting | Excel Discussion (Misc queries) | |||
Determine cells that drive conditional formatting? | Excel Discussion (Misc queries) | |||
Conditional formatting not available in Excel | Excel Discussion (Misc queries) |