Function time_calc(time_arr As Variant) As Variant Dim time_split As Variant Dim result() AsString k = 0
For i = 0To (UBound(time_arr) - LBound(time_arr)) time_split = Split(time_arr(i), "-") ReDimPreserve result(0To k) result(k) = Abs(DateDiff("n", TimeValue(time_split(1)), TimeValue(time_split(0)))) k = k + 1 Next
time_calc = result
EndFunction
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Function write_result(result_arr As Variant) Dim content AsString content = ""
For i = 0To (UBound(result_arr) - LBound(result_arr))
content = content & "" & CStr(result_arr(i)) If i < (UBound(result_arr) - LBound(result_arr)) Then content = content + Chr(10) EndIf Next
write_result = content
EndFunction
1 2 3 4 5 6 7 8 9 10 11
Function sum_result(result_arr As Variant) sum_temp = 0
For i = 0To (UBound(result_arr) - LBound(result_arr)) sum_temp = sum_temp + result_arr(i) Next