Sub CondFormat()
' Apply conditional formatting by Region for items that need review
Dim count, b As Long
count = ActiveSheet.Cells(Rows.count, "A").End(xlUp).Row 'Column A has no gap in data
b = 2 'data starts at row 2
Do While b <= count
' Region A
If Cells(b, 1).Value = "Region A" Then
Range(Cells(b, 1)).Interior.Color = RGB(180, 198, 231) 'Region This line is where Debug stops
Range(Cells(b, 7).Cells(b, 7)).Interior.Color = RGB(180, 198, 231)
Range(Cells(b, 20).Cells(b, 20)).Interior.Color = RGB(180, 198, 231)
Range(Cells(b, 19).Cells(b, 19)).Interior.Color = RGB(180, 198, 231)
End If
If Cells(b, 1).Value = "Region A" And Cells(b, 25).Value = "Invalid" Then
Range(Cells(b, 25).Cells(b, 29)).Interior.Color = RGB(180, 198, 231)
End If
If Cells(b, 1).Value = "Region A" And Cells(b, 25).Value = "Invalid " Then 'space after invalid
Range(Cells(b, 25).Cells(b, 29)).Interior.Color = RGB(180, 198, 231)
End If
If Cells(b, 1).Value = "Region A" And Cells(b, 22).Value = 0 Then
Range(Cells(b, 22).Cells(b, 22)).Interior.Color = RGB(180, 198, 231)
End If
If Cells(b, 1).Value = "Region A" And Cells(b, 5).Value = 1 _
And Cells(b, 31).Value = "No info" Then
Range(Cells(b, 5).Cells(b, 5)).Interior.Color = RGB(180, 198, 231)
Range(Cells(b, 31).Cells(b, 31)).Interior.Color = RGB(180, 198, 231)
End If
' Region B
If Cells(b, 1).Value = "Region B" Then
Range(Cells(b, 1).Cells(b, 1)).Interior.Color = RGB(248, 203, 173)
Range(Cells(b, 7).Cells(b, 7)).Interior.Color = RGB(248, 203, 173)
Range(Cells(b, 24).Cells(b, 24)).Interior.Color = RGB(248, 203, 173)
End If
If Cells(b, 1).Value = "Region B" And Cells(b, 25).Value = "Invalid" Then
Range(Cells(b, 25).Cells(b, 29)).Interior.Color = RGB(248, 203, 173)
End If
If Cells(b, 1).Value = "Region B" And Cells(b, 25).Value = "Invalid " Then 'space after invalid
Range(Cells(b, 25).Cells(b, 29)).Interior.Color = RGB(248, 203, 173)
End If
If Cells(b, 1).Value = "Region B" And Cells(b, 22).Value = 0 Then
Range(Cells(b, 22).Cells(b, 22)).Interior.Color = RGB(248, 203, 173)
End If
If Cells(b, 1).Value = "Region B" And Cells(b, 31).Value = "No info" Then
Range(Cells(b, 31).Cells(b, 31)).Interior.Color = RGB(248, 203, 173)
End If
b = b + 1
Loop
End sub
Again, I appreciate any help provided.
Bookmarks