M
Martin Wheeler
XL 2000
The code below is supposed to colour yellow all cells in the range that fill
the criteria. But it is only working on the first applicable cell and not
going on to the next.
I have scavenged the code from another app and cannot see why it is not
repeating. Any help would be greatly appreciated.
Ta,
Martin
Public Sub FiftyKYellow(wks As Worksheet)
Application.ScreenUpdating = False
On Error Resume Next
With wks
If .Range("G1").Value > 50000 Then
For Each P In .Range("P7
31")
If P.Value < -0.195 Then
Set L = P
With L.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End If
Exit For
Next
End If
Application.ScreenUpdating = True
End With
End Sub
The code below is supposed to colour yellow all cells in the range that fill
the criteria. But it is only working on the first applicable cell and not
going on to the next.
I have scavenged the code from another app and cannot see why it is not
repeating. Any help would be greatly appreciated.
Ta,
Martin
Public Sub FiftyKYellow(wks As Worksheet)
Application.ScreenUpdating = False
On Error Resume Next
With wks
If .Range("G1").Value > 50000 Then
For Each P In .Range("P7
31")If P.Value < -0.195 Then
Set L = P
With L.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End If
Exit For
Next
End If
Application.ScreenUpdating = True
End With
End Sub