I'm using this code to try and conditional format the rows with the values shown below. My problem is "Red" is the only color that's working, and i don't know why.
Code:
Dim i As LongDim Lastrow, Lastcolumn As Long
Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To Lastrow
Lastcolumn = .Cells(i, .Columns.Count).End(xlToLeft).Column
If .Cells(i, 13).Value = "Red" Then
.Range(.Cells(i, 1), .Cells(i, Lastcolumn)).Interior.Color = vbRed
ElseIf Cells(i, 13).Value = "Green" Then
.Range(.Cells(i, 1), .Cells(i, Lastcolumn)).Interior.Color = vbGreen
ElseIf Cells(i, 13).Value = "Yellow" Then
.Range(.Cells(i, 1), .Cells(i, Lastcolumn)).Interior.Color = vbYellow
End If
Next i
End With