Sub test()
Application.ScreenUpdating = False
Dim bottomH As Integer
bottomH = Range("H" & Rows.Count).End(xlUp).Row
Dim cell As Range
Dim rng As Range
Set rng = Range("H2:H" & bottomH)
For Each cell In rng
If cell >= 0 Then
cell.Interior.ColorIndex = 6
ElseIf cell < 0 Then
cell.Interior.ColorIndex = 44
End If
Next cell
Application.ScreenUpdating = True
End Sub
Hi Z. Assuming your values are in column H, try this macro:Code:Sub test() Application.ScreenUpdating = False Dim bottomH As Integer bottomH = Range("H" & Rows.Count).End(xlUp).Row Dim cell As Range Dim rng As Range Set rng = Range("H2:H" & bottomH) For Each cell In rng If cell >= 0 Then cell.Interior.ColorIndex = 6 ElseIf cell < 0 Then cell.Interior.ColorIndex = 44 End If Next cell Application.ScreenUpdating = True End Sub
Sub test()
Application.ScreenUpdating = False
If Range("F5") >= 0 Then
Range("F5").Interior.ColorIndex = 6
ElseIf Range("F5") < 0 Then
Range("F5").Interior.ColorIndex = 44
End If
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F5")) Is Nothing Then
Application.EnableEvents = False
Application.ScreenUpdating = False
If Range("F5") >= 0 Then
Range("F5").Interior.Pattern = xlNone
Range("F5").Interior.ColorIndex = 6
ElseIf Range("F5") < 0 Then
Range("F5").Interior.ColorIndex = 44
Range("F5").Interior.Pattern = 15
Range("F5").Interior.PatternColorIndex = 12
End If
Application.ScreenUpdating = True
Application.EnableEvents = True
End If
End Sub
I know how to program in file maker but not in excel where I can find the conditional formatting ?