Time Format

  • Thread starter Dr. Sachin Wagh
  • Start date
D

Dr. Sachin Wagh

Is there any way to custom time format to have milli-seconds also apart from
HH:MM:SS

tHANKS & rEGARDS
 
M

Mike H

Hi,

Custom format of

hh:mm:ss.000

Put =Now() in the cell and Tap F9 and you'll see the time update including
milliseconds

Mike
 
D

Dr. Sachin Wagh

Thanks a Ton Mike

You guys have kept Excel lively; the tip solves my problem. Just in case I'm
not stretching it too far, is there any method in which the F9 can be kept
continuosly operational (just like a watch)

Thanks & Regards
 
M

Mike H

Hi,

Yes you can do that but need to bear in mind that while the workbook is
updating this clock the performance 'may' deteriorate. Try this.

Put these 2 short macros in 'This Workbook'

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:8"), "CalcMacro"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime dTime, "CalcMacro", , False
End Sub

And this one in an ordinary module

Public dTime As Date
Sub CalcMacro()
dTime = Now + TimeValue("00:00:08")
Application.OnTime dTime, "CalcMacro"
Application.Calculate
End Sub

You can set the time interval to update to what you want, currently set at 8
seconds.

Mike
 
D

Dr. Sachin Wagh

Thanks Mike
--
Dr. Sachin Wagh
MBBS, DHA, DPH


Mike H said:
Hi,

Yes you can do that but need to bear in mind that while the workbook is
updating this clock the performance 'may' deteriorate. Try this.

Put these 2 short macros in 'This Workbook'

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:8"), "CalcMacro"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime dTime, "CalcMacro", , False
End Sub

And this one in an ordinary module

Public dTime As Date
Sub CalcMacro()
dTime = Now + TimeValue("00:00:08")
Application.OnTime dTime, "CalcMacro"
Application.Calculate
End Sub

You can set the time interval to update to what you want, currently set at 8
seconds.

Mike
 
Top