I am trying to write a conditional case statement that searches through a specific column, in excel, for a specific string and when it matches with the string that cell's background color is changed.
If the cell is empty or does not match the string then nothing should happen to the cell.
Right now I am trying to iterate through each cell in the column and check all possible string values to compare to but it does not seem to be working .
Here is my current code:
Sub interiorsStatus()
Dim sh As Worksheet
Dim rw As Range
Set sh = ActiveSheet
For Each rw In sh.Rows
Select Case sh.Cells(rw.Row, "E").Value
Case "DELIVERED"
result = Range(rw.Row).Interior.ColorIndex = 33
Case "READY TO ORDER"
result = Range(rw.Row).Interior.ColorIndex = 36
Case "ORDERED"
result = Range(rw.Row).Interior.ColorIndex = 39
Case "DELIVERED"
result = Range(rw.Row).Interior.ColorIndex = 43
Case "EXISTING"
result = Range(rw.Row).Interior.ColorIndex = 40
Case "ON HOLD"
result = Range(rw.Row).Interior.ColorIndex = 48
Case "GENERAL CONTRACTOR"
result = Range(rw.Row).Interior.ColorIndex = 2
Case "AV & BLINDS"
result = Range(rw.Row).Interior.ColorIndex = 15
Case "MILLWORK"
result = Range(rw.Row).Interior.ColorIndex = 22
Case Else
result = """"
End Select
Exit For
Next rw
End Sub