View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mvyvoda mvyvoda is offline
external usenet poster
 
Posts: 41
Default How to Get Date of Each Cell....

I need to highlight each cell in a column that satisfies anything earlier
than the current date+1 (e.g. anything earlier than 2006-06. June '06). They
have to be processed as strings, thus the fist two lines.

s_current = Format(DateSerial(Year(Date), Month(Date), Day(Date)), "yyyy-mm")
s_past = Format(DateSerial(Year(Date), Month(Date) - 1, 1), "yyyy-mm")
Application.Goto Reference:="MP_Start"
myMPStartColumn = ActiveCell.Column
Set rng = ActiveCell.EntireRow
For Each cell In rng
If s_current = s_past Then
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
End If
Next

I know this isn't doing anything (I need to do something with "cell"). How
to I evalutate each cell in the colume and compare it against the current
date, thus being able to highlight, given that criteria?

Please help!

Thanks,
Mark