Hello,
I created a macro awhile ago to perform a pretty simple function in Excel 2003. The macro just goes down two specified columns and if a date is entered it is checked against whatever today's date is. If today's date is past the entered date the cell turns red, otherwise the cell is green. The macro worked flawlessly in Excel 2003. However now in Excel 2007 whenever the macro run a Runtime Error 13 occurs. Here is the code
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
For Each c In Range("E3:E567,H3:H567")
If c.Value <> "" Then
If CDate(c.Value) < Now Then
c.Interior.Color = vbRed
Else
c.Interior.Color = vbGreen
End If
End If
Next c
End Sub
The error occurs at the
If c.Value <> "" Then
line and is noted with Error = 2015
Thanks in advance for any advice!
Bookmarks