Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Excel > Excel Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 12-05-2018, 05:42 PM
kevinbradley57 kevinbradley57 is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Jul 2017
Posts: 68
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
  #2  
Old 12-05-2018, 07:35 PM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 685
NoSparks will become famous soon enoughNoSparks will become famous soon enough
Default

have you tried changing the 11 to a 6 or F in quotes ("F") ?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting a Date in Date Picker and Having it change dates throughout joshuaran Word VBA 2 03-14-2018 09:24 PM
Change a part of date or the number color Jazzis Excel 3 10-15-2016 01:49 AM
How can I make a cell color RED under the Today's date cell? Learner7 Excel 2 07-08-2010 12:52 AM
new appointment date always reverts back to today's date msills Outlook 0 08-24-2007 08:57 AM
Imported message date change to today's date promark Outlook 1 12-23-2005 07:21 AM


All times are GMT -7. The time now is 10:46 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft