I don't think you use Cell references that way. Use the Range object.
Sub DATEADD()
If (Range("A7").Value < Range("E6").Value) Then
Range("A7").Value = DATEADD("d", 1, CDate(Range("E6").Value))
End If
End Sub
In stead of hard coding the cells like this, why not just re-sequence all the dates
Like this;
StartRow = 2
EndRow = 20
MyDate=CDate("1/1/2012")
For MyRow = StartRow to EndRow
Cells(MyRow,1).Value=MyDate
MyDate = DATEADD("d", 1, MyDate)
Cells(MyRow,5).Value=MyDate
MyDate = DATEADD("d", 1, MyDate)
Next MyRow
Bookmarks