Hello Jell,
This macro will format the row text based on what is in cell "O". Change the worksheet name to what you are using. I was not sure if the last letter after the "B" was "L" or "I" because of the font. Change that if it it isn't right before you run the macro.
Sub FormatText()
Dim ColC As String
Dim R As Long
Dim Rng As Range
Dim RngEnd As Range
Dim TextColor As Long
Dim Wks As Worksheet
Set Wks = Worksheets("Sheet1")
Set Rng = Wks.Range("A1:BI1")
Set RngEnd = Wks.Cells.Find("*", , xlValues, xlWhole, xlByRows, xlPrevious, False)
Set Rng = Rng.Resize(RowSize:=RngEnd.Row - Rng.Row + 1)
For R = 1 To Rng.Rows.Count
Select Case LCase(Rng.Cells(R, "C"))
Case Is = "c"
If Int(Rng.Cells(R, "J")) > Int(Now()) Then
ColC = "CW"
TextColor = 10 'Dark Green
End If
If Int(Rng.Cells(R, "J")) <= Int(Now()) Then
ColC = "C"
TextColor = 3 'Red
End If
Case Is = "n"
If IsEmpty(Rng.Cells(R, "P")) Then
ColC = "W"
TextColor = 11 'Dark Blue
End If
If IsDate(Rng.Cells(R, "P")) Then
ColC = "E"
TextColor = 1 'Black
End If
Case Is = "rc"
If IsDate(Rng.Cells(R, "L")) Then
ColC = "C"
TextColor = 3 'Red
End If
Case Is = "rn"
If IsDate(Rng.Cells(R, "L")) Then
ColC = "E"
TextColor = 1 'Black
End If
Case Is = "rc", "rn"
If IsEmpty(Rng.Cells(R, "L")) Then
ColC = "W"
TextColor = 11 'Dark Blue
End If
Case Else
TextColor = 1 'Black
End Select
Rng.Rows(R).EnitreRow.Font.ColorIndex = TextColor
Next R
End Sub
Bookmarks