![]() |
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 -- TheLeafs ------------------------------------------------------------------------ TheLeafs's Profile: http://www.excelforum.com/member.php...o&userid=10131 View this thread: http://www.excelforum.com/showthread...hreadid=508253 |
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" wrote in message ... 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 |
All times are GMT +1. The time now is 10:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com