我正在尝试在Excel宏中显示毫秒。我有一列整数,它们是以毫秒为单位的时间戳(例如,28095200是7:48:15.200 am),我想在它旁边创建一个新列,用于保存运行平均值并以hh:mm:ss.000
格式显示时间。
Dim Cel As Range
Set Cel = Range("B1")
temp = Application.Average(Range("A1:A2")) / 1000
ms = Round(temp - Int(temp), 2) * 1000
Cel.Value = Strings.Format((temp / 60 / 60 / 24), "hh:mm:ss") _
& "." & Strings.Format(ms, "#000")
这只会在单元格中显示"mm:ss.0“。然而,当我单击单元格时,它在公式栏中显示"hh:mm:ss“。为什么时间不见了?如何显示小时、分钟、秒和毫秒?
https://stackoverflow.com/questions/3095407
复制相似问题