Calculate time difference with VBA in Microsoft Excel

The VBA function DateDiff () is used to calculate the difference between two times:

Sub UhrzeitSubtrahieren()
ThisWorkbook.Worksheets("Tabelle1").Activate
Range("F3").Value = DateDiff("n", _
Range("F2").Value, Range("F1").Value)
Range("F3").NumberFormatLocal = "0"
End Sub

The DateDiff () function is used to calculate the difference between two times (second and third parameters). The unit of the time difference is specified in the first parameter. There are the same possibilities for this as with DateAdd ().

Was the explanation to "Calculate time difference with VBA in Microsoft Excel"Helpful? Rate now:

Weitere Erklärungen zu Skriptsprachen