View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Al Franz Al Franz is offline
external usenet poster
 
Posts: 21
Default Automatically Hightlight Rows with w/Date Check?

Steve,

Thanks a lot, I took your advice and recorded a macro. The following is
what the code looked like. Is there an easy way to make the value of "8" I
coded in below a variable, so when I run the macro Excel would prompt me for
a value (i.e. number of days back to highlight)?

Cells.Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=NOW()-$P1<8"
With Selection.FormatConditions(1).Interior
.ColorIndex = 37
.Pattern = xlSolid
End With