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?