View Single Post
 
Old 12-05-2018, 05:42 PM
kevinbradley57 kevinbradley57 is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Jul 2017
Posts: 87
kevinbradley57 is on a distinguished road
Default Change font color if date in column F is prior to today's date.

I have a spreadsheet in which Column F of every row is a different date. This code only works on the first row after the header. Help?
Code:
Sub PastDue()

    Dim rCell As Range

    With Sheet1
        For Each rCell In .Range("F2", .Cells(.Rows.Count, 11).End(xlUp)).Cells
            If rCell <> "" And IsDate(rCell) And rCell.Value < Date Then
                rCell.Font.color = vbRed
            End If
        Next rCell
    End With

End Sub

Last edited by kevinbradley57; 12-05-2018 at 06:35 PM. Reason: Forgot code
Reply With Quote