Tenure - Anniversary Year

T

TheLeafs

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top