Results 1 to 2 of 2

Leap year

Threaded View

  1. #1
    Registered User
    Join Date
    08-29-2008
    Location
    Virginia
    Posts
    48

    Leap year

    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
    Last edited by samirz10; 10-10-2008 at 01:07 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excluding the leap year in a date formula
    By babstierney in forum Excel General
    Replies: 4
    Last Post: 08-27-2012, 05:47 AM
  2. Leap year calculations
    By SiameseTurtle in forum Excel General
    Replies: 7
    Last Post: 08-02-2008, 09:48 PM
  3. Trivia
    By ChemistB in forum The Water Cooler
    Replies: 30
    Last Post: 06-16-2008, 06:54 PM
  4. Leap Year
    By realsaggi in forum Excel General
    Replies: 6
    Last Post: 08-27-2007, 01:29 PM
  5. Future value of money?
    By Alib in forum Excel General
    Replies: 1
    Last Post: 01-13-2007, 04:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1