Hi,
The following code adds 5 years to approval date which is fine but it doesn't seem to like to deal with leap year. For instance, if approval date is 02/29/08, it doesn't do anything. Can anybody help me tackle this problem?
![]()
Dim approvaldate As Date Dim nextYear As Integer ' determine the current date value approvaldate = Target.Offset(0, 5).Value ' increment the year nextYear = Year(approvaldate) + 5 Expiration Date = DateValue(Format(approvaldate, "mm/dd") & "/" & nextYear) End If
Bookmarks