No need for a UDF.
Use the following formula
Where A1 is time 1 and B1 is time 2. The abs makes it possible so that neither time has to be before or after the other.
If you need to use the UDF that you've created then:
Code:Function TimeDiff(StartTime As Date, StopTime As Date) TimeDiff = abs(StopTime-StartTime) * 86400 End Function