|
||||
These pages are no longer updated and are only available for archive purposes.Click here to visit the pages with updated information. Time intervalsIf you need to calculate the difference between two time values within a certain limit (e.g. when calculating elapsed work time), the worksheet function below can be useful since it makes it simple to perform the time interval calculation. Function TimeInterval(StartTime As Double, EndTime As Double, _ LowerLimit As Double, UpperLimit As Double) As Double ' returns EndTime-StartTime limited by LowerLimit and UpperLimit TimeInterval = 0 If StartTime > EndTime Then Exit Function If StartTime > UpperLimit Then Exit Function If EndTime < LowerLimit Then Exit Function If StartTime < LowerLimit Then StartTime = LowerLimit If EndTime > UpperLimit Then EndTime = UpperLimit TimeInterval = EndTime - StartTime End Function Example:
Document last updated 2000-02-04 12:45:22 Printerfriendly version
|
||||
|