billandrew
Well-known Member
- Joined
- Mar 9, 2014
- Messages
- 743
Evening
Is this a proper way to highlight specific ranges
Thanks
Sub HighlightIf()
Dim c As Range, r As Range, lr As Long, s As Range, q As Range
lr = Range("D" & Rows.Count).End(xlUp).Row
Set r = Range("D2:E" & lr)
For Each c In r
If c.Value > 2000 And c.Value < 200000 Then
c.Interior.ColorIndex = 4
End If
Next c
Set q = Range("F2:F" & lr)
For Each s In q
If s.Value > 180000 Then
s.Interior.ColorIndex = 6
End If
Next
Is this a proper way to highlight specific ranges
Thanks
Sub HighlightIf()
Dim c As Range, r As Range, lr As Long, s As Range, q As Range
lr = Range("D" & Rows.Count).End(xlUp).Row
Set r = Range("D2:E" & lr)
For Each c In r
If c.Value > 2000 And c.Value < 200000 Then
c.Interior.ColorIndex = 4
End If
Next c
Set q = Range("F2:F" & lr)
For Each s In q
If s.Value > 180000 Then
s.Interior.ColorIndex = 6
End If
Next