Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Conversion en heure / minutes

2 réponses
Avatar
Boby Lapointe
Bonjour,

J'ai une macro dans laquelle j'arrondis une variable (voir ci-dessous) et je
voudrais pouvoir l'utiliser tel que si TMT = 10 alors TMT soit "00:10" (sous
le format hh:mm )
If 20 < TTT > 26 Then TMT = 25
If 25 < TTT > 31 Then TMT = 30
If 30 < TTT > 36 Then TMT = 35
Merci d'avance.

Bob

2 réponses

Avatar
Ellimac
Bonjour,

Conversion :
TMT=Format(TMT,"0:00")
Les tests :

Sub Toto()
If TMT = 10 Then
TMT = 10
ElseIf TMT < 26 Then
TMT = 25
ElseIf TMT < 31 Then
TMT = 30
Else
TMT = 35
End If
TMT = Format(TMT / 24 / 60, "h:mm")
End Sub

Camille


Bonjour,

J'ai une macro dans laquelle j'arrondis une variable (voir ci-dessous) et je
voudrais pouvoir l'utiliser tel que si TMT = 10 alors TMT soit "00:10" (sous
le format hh:mm )
If 20 < TTT > 26 Then TMT = 25
If 25 < TTT > 31 Then TMT = 30
If 30 < TTT > 36 Then TMT = 35
Merci d'avance.

Bob


Avatar
Boby Lapointe
Bonjour Camille,

Merci de ton aide.
Effectivement les tests if then n'étaient pas bon et je n'obtenais aucune
valeur.
Merci encore

Bob


Bonjour,

Conversion :
TMT=Format(TMT,"0:00")
Les tests :

Sub Toto()
If TMT = 10 Then
TMT = 10
ElseIf TMT < 26 Then
TMT = 25
ElseIf TMT < 31 Then
TMT = 30
Else
TMT = 35
End If
TMT = Format(TMT / 24 / 60, "h:mm")
End Sub

Camille


Bonjour,

J'ai une macro dans laquelle j'arrondis une variable (voir ci-dessous) et je
voudrais pouvoir l'utiliser tel que si TMT = 10 alors TMT soit "00:10" (sous
le format hh:mm )
If 20 < TTT > 26 Then TMT = 25
If 25 < TTT > 31 Then TMT = 30
If 30 < TTT > 36 Then TMT = 35
Merci d'avance.

Bob