View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Conditional Formatting

Sub dt()
lr = Cells(Rows.Count, 17).End(xlUp).Row
For i = 1 To lr
x = Date
y = Range("Q" & i).Value
If x - y <= 7 Then
Range("D" & i).Interior.ColorIndex = 6
ElseIf x - y = 8 And x - y <= 14 Then
Range("D" & i).Interior.ColorIndex = 12
ElseIf x - y = 15 Then
Range("D" & i).Interior.ColorIndex = 3
End If
Next
End Sub

"Nic" wrote:

I have a spreadsheet with documents that are overdue. I want column D, which
contains the contract number for that doucment, to be highlighted when the
due date in column Q has past.

However, there are three different colours I want column D to be
highlighted, red if over 2 weeks overdue, orange if 1-2 weeks overdue and
yellow if 0-1 week overdue.

I would appreciate any help on this one!!

Cheers
Nic