hi Friends ,
Regarding conditional formatting i have checked couple of examples and created the below code however its not working not sure why , Could anyone please review and share where i am making a mistake , also if need to apply this only in the specific sheet names Raw , how do i append it .
Dim k As Long, r1 As Range, r2 As Range
For k = 2 To 5
Set r1 = Range("C18" & k)
Set r2 = Range("B29" & k & ":C33" & k)
If r1.Value >= 500 Then r2.Interior.Color = vbGreen
If r1.Value > 1000 Then r2.Interior.Color = vbYellow
If r1.Value > 2000 Then r2.Interior.Color = vbRed
If r1.Value > 5000 Then r2.Interior.Color = vbYellow
If r1.Value >= 5000 Then r2.Interior.Color = vbYellow
Next k
Regarding conditional formatting i have checked couple of examples and created the below code however its not working not sure why , Could anyone please review and share where i am making a mistake , also if need to apply this only in the specific sheet names Raw , how do i append it .
Dim k As Long, r1 As Range, r2 As Range
For k = 2 To 5
Set r1 = Range("C18" & k)
Set r2 = Range("B29" & k & ":C33" & k)
If r1.Value >= 500 Then r2.Interior.Color = vbGreen
If r1.Value > 1000 Then r2.Interior.Color = vbYellow
If r1.Value > 2000 Then r2.Interior.Color = vbRed
If r1.Value > 5000 Then r2.Interior.Color = vbYellow
If r1.Value >= 5000 Then r2.Interior.Color = vbYellow
Next k