Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


--
TheLeafs
------------------------------------------------------------------------
TheLeafs's Profile: http://www.excelforum.com/member.php...o&userid=10131
View this thread: http://www.excelforum.com/showthread...hreadid=514494

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in
message ...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
tenure Janice Reid Excel Worksheet Functions 14 October 13th 08 07:37 AM
Days to next anniversary smaruzzi Excel Discussion (Misc queries) 36 July 10th 07 05:44 AM
working with employee tenure and grouping Casey Tremper Excel Worksheet Functions 2 April 6th 07 03:28 PM
automated employee tenure summary using Customized Charts with VBA tweety127 Charts and Charting in Excel 0 May 22nd 06 07:24 PM
How do I get an anniversary date? Steve j. Excel Worksheet Functions 1 November 18th 04 04:10 PM


All times are GMT +1. The time now is 07:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"