+ Reply to Thread
Results 1 to 3 of 3

Tenure - Anniversary Year

  1. #1
    Registered User
    Join Date
    06-01-2004
    Posts
    36

    Tenure - Anniversary Year

    Good day,

    I am trying to determine if Employee's are in a 5th anniversary year of there tenure. For example, employees's that started with the company on Aug 8, 2001; are in there anniversary year for there 5th year, so there vacation time will increase. I understand how to get Length of Service but cannot figure out this part. I was also thinking of trying to determine the End of Year date from sDate and maybe figure out from here but not sure.
    Any help would be great.

    Dim sDate as Date
    sDate = Sheets("Main").Cells(5, 4)
    Dim LOS As Integer
    LOS = (Year(Now) - Year(sDate)) * 12 + Month(Now) - Month(sDate)

    Chris

  2. #2
    Tom Ogilvy
    Guest

    Re: Tenure - Anniversary Year

    http://www.cpearson.com/excel/datedif.htm
    Chip Pearson's page on datedif (the worksheet function) and datediff (the
    vba function. )

    Read the whole page and I think it will provide you the information you
    need.

    --
    Regards,
    Tom Ogilvy


    "TheLeafs" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Good day,
    >
    > I am trying to determine if Employee's are in a 5th anniversary year of
    > there tenure. For example, employees's that started with the company on
    > Aug 8, 2001; are in there anniversary year for there 5th year, so there
    > vacation time will increase. I understand how to get Length of Service
    > but cannot figure out this part. I was also thinking of trying to
    > determine the End of Year date from sDate and maybe figure out from
    > here but not sure.
    > Any help would be great.
    >
    > Dim sDate as Date
    > sDate = Sheets("Main").Cells(5, 4)
    > Dim LOS As Integer
    > LOS = (Year(Now) - Year(sDate)) * 12 + Month(Now) - Month(sDate)
    >
    > Chris
    >
    >
    > --
    > TheLeafs
    > ------------------------------------------------------------------------
    > TheLeafs's Profile:

    http://www.excelforum.com/member.php...o&userid=10131
    > View this thread: http://www.excelforum.com/showthread...hreadid=514494
    >




  3. #3
    Toppers
    Guest

    RE: Tenure - Anniversary Year

    Look at VBA DateAdd function: code below is modified from VBA help

    Dim FirstDate As Date ' Declare variables.
    Dim IntervalType As String
    Dim Number As Integer
    Dim Msg
    IntervalType = "yyyy" ' "yyyy" specifies years as interval.
    FirstDate = InputBox("Enter a date")
    Number = InputBox("Enter number of years to add")
    Msg = "New date: " & DateAdd(IntervalType, Number, FirstDate)
    MsgBox Msg


    HTH

    "TheLeafs" wrote:

    >
    > Good day,
    >
    > I am trying to determine if Employee's are in a 5th anniversary year of
    > there tenure. For example, employees's that started with the company on
    > Aug 8, 2001; are in there anniversary year for there 5th year, so there
    > vacation time will increase. I understand how to get Length of Service
    > but cannot figure out this part. I was also thinking of trying to
    > determine the End of Year date from sDate and maybe figure out from
    > here but not sure.
    > Any help would be great.
    >
    > Dim sDate as Date
    > sDate = Sheets("Main").Cells(5, 4)
    > Dim LOS As Integer
    > LOS = (Year(Now) - Year(sDate)) * 12 + Month(Now) - Month(sDate)
    >
    > Chris
    >
    >
    > --
    > TheLeafs
    > ------------------------------------------------------------------------
    > TheLeafs's Profile: http://www.excelforum.com/member.php...o&userid=10131
    > View this thread: http://www.excelforum.com/showthread...hreadid=514494
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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