Can someone help with this? It doesn't error, but it doesn't work either.
1. I don't think it's cycling through the cells, but I don't know how to make it.
2. It doesn't work
It should look at the date, compare with current and set the Font.
Code:Sub DateText() Dim ws As Worksheet, dCell As Range Set ws = Sheets("LD") Set dCell = ws.Range("B6:B82") '- the number of days between today and the doc date '- NOTE: the "d" tells the DateDiff function to return the difference '- in days numOfDays = DateDiff("d", dToday, dCell.Text) '- with blocks simply save typing... here it applies everywhere you see '- .Font (it really means dCell.Font.ColorIndex = 3 With dCell.Font '- i think the select statement is faster than a large if statement Select Case (numOfDays) '- if the doc date is within a week of today... '- Two Weeks Case Is <= 14 '- ... yellow .ColorIndex = 6 '-One Week Case Is <= 7 '- ... Red .ColorIndex = 3 End Select End With 'On Error GoTo 0 End Sub




Reply With Quote
