Thread: So close
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
E2out E2out is offline
external usenet poster
 
Posts: 6
Default So close

Can anyone help me out here? I want to change the font color of a cell
depending on a conditional test (4<cell contents<90)

Here is my code



Sub nums()
Worksheets("sheet1").Activate
Range("b2").Select
Range("b2").Activate
Dim a As Integer
a = Worksheets("sheet1").Range("b2").Value
If (5 < a < 8) Then
Worksheets("sheet1").Range("b2").Font.Color = RGB(255, 0, 0)
Worksheets("sheet1").Range("b2").Font.Color = RGB(0, 0, 255)
End If
End Sub


Thanks!

JP