Heure ss format 00"H"00 utilissable pour un calcul

  • Initiateur de la discussion Guigui
  • Date de début
G

Guigui

Guest
hello le forum,

Je souhaite faire un calcul d'heure sachant que je voudrait rentrer mes heures comme ceci :

Heure début en A1
0815 ==> (avec un format de cellule - 00'H'00) ==> 08H15 est écrit

Heure fin en B1
1800 ==> (avec un format de cellule - 00'H'00) ==> 18H00 est écrit

Amplitude en C1
=B1-A1
mais je voudrais un resultat en centieme
ici 09h45 travaillé soit 9,75

9,75 est mon format attendu en C1

Si quelqu'un a une solution....

Merci d'avance

A+ guillaume
 

boudoula

XLDnaute Nouveau
Bonjour,

j'ai préparé un petit quelquechose j'espère que ça repond au besoin

bye [file name=Conversion temps_20050325201357.zip size=14468]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/Conversion temps_20050325201357.zip[/file]
 

Pièces jointes

  • Conversion temps_20050325201357.zip
    14.1 KB · Affichages: 72

pat1545.

XLDnaute Accro
Salut,

il doit y avoir + court mais pas le temps :

Private Sub CommandButton1_Click()
a = UserForm1.TextBox1.Value
b = UserForm1.TextBox2.Value
c = UserForm1.TextBox3.Value
d = UserForm1.TextBox4.Value

e = CInt(UserForm1.TextBox1.Value)
f = CInt(UserForm1.TextBox2.Value)
g = CInt(UserForm1.TextBox3.Value)
h = CInt(UserForm1.TextBox4.Value)

hdeb = a & 'H' & b
Range('A1000').Value = Left(hdeb, 2) & ':' & Right(hdeb, 2)
Range('A1') = hdeb
Range('A1').HorizontalAlignment = xlCenter
Range('A1').VerticalAlignment = xlCenter
deb = Range('A1').Value
hfin = c & 'H' & d
Range('B1000').Value = Left(hfin, 2) & ':' & Right(hfin, 2)
Range('B1') = hfin
Range('B1').HorizontalAlignment = xlCenter
Range('B1').VerticalAlignment = xlCenter
fin = Range('B1').Value
'Hdeb = Range('A1000').Value
hdeb = Int(e) & ':' & f & ':00'
hfin = g & ':' & h & ':00'
'hfin = Range('B1000').Value
aa = CDate(hdeb)
bb = CDate(hfin)
result = (bb - aa) * 24
Range('C1') = result


End Sub

Bye
 

Discussions similaires

Réponses
7
Affichages
2 K

Statistiques des forums

Discussions
314 011
Messages
2 104 528
Membres
109 061
dernier inscrit
nedjima