Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Tenure - Anniversary Year

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TheLeafs - 20 Feb 2006 19:01 GMT
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

Signature

TheLeafs

Tom Ogilvy - 20 Feb 2006 19:14 GMT
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.

Signature

Regards,
Tom Ogilvy

> Good day,
>
[quoted text clipped - 13 lines]
>
> Chris
Toppers - 20 Feb 2006 19:21 GMT
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

> Good day,
>
[quoted text clipped - 13 lines]
>
> Chris
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.