You could use the calculate event
[vba]
Private Sub Worksheet_Calculate()
With Me.Range("D5")
If IsDate(.Value) Then
Me.Tab.ColorIndex = xlColorIndexNone
If Abs(.Value - Date) <= 7 Then
Me.Tab.Color = vbYellow
End If
End If
End With
End Sub
[/vba]