+ Reply to Thread
Results 1 to 2 of 2

Determine Length of Service

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

    Determine Length of Service

    Good day,

    I am tring to determine in VBA the length of service employees have been with a company in months. For example, how many months is between:
    05/01/02
    02/03/06
    I am looking to set this up in a Macro, I can understand how to do this in days but not months.
    startdate = Sheets("Main").Cells(5, 4)
    LOS = Now - sdate
    I was wondering if anyone can assist me with this.

    Thanks

  2. #2
    Tom Ogilvy
    Guest

    Re: Determine Length of Service

    ? datediff("m",DateValue("05/01/02"),DateValue("02/03/06"))
    45

    Should give you some Ideas. Read the help and then test it on some dates
    to see if your intepretation of months matches its interpretation.

    --
    Regards,
    Tom Ogilvy

    "TheLeafs" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Good day,
    >
    > I am tring to determine in VBA the length of service employees have
    > been with a company in months. For example, how many months is
    > between:
    > 05/01/02
    > 02/03/06
    > I am looking to set this up in a Macro, I can understand how to do this
    > in days but not months.
    > startdate = Sheets("Main").Cells(5, 4)
    > LOS = Now - sdate
    > I was wondering if anyone can assist me with this.
    >
    > Thanks
    >
    >
    > --
    > TheLeafs
    > ------------------------------------------------------------------------
    > TheLeafs's Profile:

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




+ 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