Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Zaahir,
I tried to do the same on my userform and was told that in order for the label to get constantatly updated one has to call a procedure every second here is the code I got from the internet...(it updates every 60 seconds so if you want it to update every second change to 1 and change the format to hh:mm:ss) Regards, Ozgur Public RunWhen As Double Public Const cRunIntervalSeconds = 60 Public Const cRunWhat = "The_Sub" Sub StartTimer() RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds) Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, schedule:=True End Sub Sub The_Sub() UserForm2.Label475.Caption = Format(Now, "dd mmm yy hh:mm") UserForm2.Label476.Caption = Format(Now, "dd mmm yy hh:mm") UserForm2.Label514.Caption = Format(Now, "dd mmm yy hh:mm") Call StartTimer End Sub Sub StopTimer() On Error Resume Next Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, schedule:=False End Sub "Zaahir" wrote: hi i want to make a clock using a label, but of i use the time & now values, the result returned is the time at which the macro was run.... How do i get the a watch response out of the label, to give me hh:mm:ss continuously? Regards |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Time calculations for Scheduled Time vs. Actual Time Worked | Excel Discussion (Misc queries) | |||
straight time, time and a half, and double time | Excel Discussion (Misc queries) | |||
Calculate Ending time using Start Time and Elapsed Time | Excel Worksheet Functions | |||
Subtracting Dates to get total time work time excluding weekends | Excel Discussion (Misc queries) | |||
Calculating days & time left from start date/time to end date/time | Excel Worksheet Functions |