I am trying to track how much time an employee is taking for lunch.
Here is some more data. The clock out is what time the employee clocked out for lunch and the Clock On is what time the employee clocked back in from lunch.
I need to convert the Clock Off and Clock On from text to time so I can calculate how much time the employee took for lunch.
Public Function CTime(inputStr As String) As Date
[COLOR=Green]'**********************
'Code Courtesy of
' Paul Eugin
'**********************[/COLOR]
inputStr = Format(inputStr, "0000")
CTime = TimeSerial(CLng(Left(inputStr, 2)), CLng(Right(inputStr, 2)), 0)
End Function
Use the function in a Standard module. Give the module a name different than the function name.