2016-08-29 12 views
-4

私はリストボックスに時間aと時間bの間の時間数を表示する方法を見つけようとしています。 注:ティムポアは、明らかに時刻bの前に「今」と一緒に撮影されました。時間数を表示

Dim tiempoa As Date 
Dim tiempob As Date 
Dim tiempoc As Date 

tiempoa = .Offset(, -18).Value 
tiempob = Now 
tiempoc = Format(tiempoa - tiempob, "hh:mm") 

Data(i, 5) = tiempoc 

This is whats displayed, even it showld be around 80 hours.

+0

私はあなたが最後に尋ねたときのコメントでこれを答えました。書式を "[h]:mm"に変更してください。 –

+0

@DougGlancyは動作しません 私もこれを試しています。 tiempoa = .Offset(-18).Valueの tiempob =今 tiempoc = DateDiff関数(HHH、tiempoa、tiempob) データ(I、5)= tiempoc –

+0

I画像を追加 –

答えて

1

私はそれを考え出しました。

tiempoa = .Offset(, -18).Value 
    tiempob = Now 
    tiempoc = DateDiff("h", tiempoa, tiempob) 

Data(i, 5) = tiempoc 
関連する問題