View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bojames Bojames is offline
external usenet poster
 
Posts: 15
Default What do I need to add to my macro to make the cell colors change

"Bojames" wrote:

What do I need to add to the macro listed below to make the cell colors
change to yellow after 1 day change and to red after 2 days? Below is the Macro.


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("C2:C1000"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub