Sub Test()
Dim Txt1 As String, Txt2 As String
Randomize
Do
Txt1 = Format(Now + 40 * Rnd, "dd.mm.yyyy hh:mm:ss")
Txt2 = Format(Now, "dd.mm.yyyy hh:mm:ss")
Loop Until MsgBox(Txt1 & vbLf & Txt2 & vbLf _
& Format(CDate(Replace(Txt1, ".", "/")) - CDate(Replace(Txt2, ".", "/")), "0.00"" jours"""), _
vbOKCancel + vbInformation, "Test") = vbCancel
End Sub