Bonsoir le forum,
j'ai besoin de réalisé un calcul de temps d'indisponibilité entre 2 dates en faisant une soustraction :
date fin - date début ==> Afficher le résultat au format jj:hh:mm:ss
J'ai trouvé de nombreux fils qui abordait ce style de sujet mais je n'ai pas trouvé mon bonheur...
Voici ou j'en suis :
mais le résultat en sortie est incohérent ;-( voir PJ
Merci pour votre aide
j'ai besoin de réalisé un calcul de temps d'indisponibilité entre 2 dates en faisant une soustraction :
date fin - date début ==> Afficher le résultat au format jj:hh:mm:ss
J'ai trouvé de nombreux fils qui abordait ce style de sujet mais je n'ai pas trouvé mon bonheur...
Voici ou j'en suis :
VB:
For i = 2 To L3
tps_indispo = ""
If Cells(i, 12).Value <> "" Then
With ThisWorkbook.Sheets("Rapport Exploitation")
tps_indispo = CDate(.Cells(i, 12)) - CDate(.Cells(i, 11))
End With
MsgBox Format(tps_indispo, jj & " jours " & hh & " hrs " & mm & " min " & ss & " sec. ")
Else
With ThisWorkbook.Sheets("Rapport Exploitation")
tps_indispo = CDate(Now) - CDate(.Cells(i, 11))
End With
MsgBox Format(tps_indispo, jj & " jours " & hh & " hrs " & mm & " min " & ss & " sec. ")
End If
Next i
mais le résultat en sortie est incohérent ;-( voir PJ
Merci pour votre aide
Pièces jointes
Dernière édition: