View Single Post
  #7   Report Post  
Brian in FT W.
 
Posts: n/a
Default

I went with this, but it still gave me an error: Run-Time error 438
Object doesn't support this property or method.

Case Is <= 4#
..ColorIndex = 5
..Font.ColorIndex = 2

I also tried, but this didn't work.
Case Is <= 4#
.Interior.ColorIndex = 5
.Font.ColorIndex = 2


"JE McGimpsey" wrote:

One way:

Replace "A1:M99" with your desired cells, say "A1, B2, J14":

Private Sub Worksheet_Change(ByVal Target As Range)
With Target(1)
If Not Intersect(.Cells, Range("A1:M99")) Is Nothing Then
.Font.ColorIndex = xlColorIndexAutomatic
Select Case Application.Round(.Value, 2)
Case Is < 0
.Interior.ColorIndex = xlNone
Case Is < 1.1
.Interior.ColorIndex = 3
Case Is < 2.5
.Interior.ColorIndex = 6
Case Is < 3.5
.Interior.ColorIndex = 4
Case Is <= 4#
.Interior.ColorIndex = 5
.Font.ColorIndex = 2
Case Else
.Interior.ColorIndex = xlColorIndexNone
End Select
End If
End With
End Sub

In article ,
"Brian in FT W." wrote:

That worked, thanks Bernie. Also, how would I get the font to change to white
for the Blue Cells? Is there any way to make the code work only for certain
cells, or is this a worksheet-wide application only?