Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Pooh,
In a regular module, use Option Explicit Public StartTime As Date Public RunTime As Date Sub ShowmyForm() Load UserForm1 UserForm1.Show End Sub Sub UpdateTime() RunTime = Now + TimeValue("00:00:01") UserForm1.TextBox1.Text = Format(Now - StartTime, "hh:mm:ss") Application.OnTime RunTime, "UpdateTime" End Sub On the userform, add a textbox (Textbox1) and use Private Sub UserForm_Deactivate() Application.OnTime RunTime, "UpdateTime", , False End Sub Private Sub UserForm_Initialize() StartTime = Now UserForm1.TextBox1.Text = Format(Now - StartTime, "hh:mm:ss") RunTime = Now + TimeValue("00:00:01") Application.OnTime RunTime, "UpdateTime" End Sub HTH, Bernie MS Excel MVP "wynnyderpooh" wrote in message ... I need to display a running timer in an Excel form. Start the timer when the form opens and stop the timer as the form closes. I use frmTmr with lblTmr I have attempted to use the Time functions with no success |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Timer to flash msg on a form | Excel Programming | |||
Timer in Excel | Excel Programming | |||
Stopping a Timer / Running a timer simultaneously on Excel | Excel Discussion (Misc queries) | |||
EXCEL 2002: How do I user/simulate a Timer event in Excel form | Excel Programming | |||
EXCEL 2002: How do I user/simulate a Timer event in Excel form | Excel Programming |