Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
clock on user form
I have set up a user form (userform1) and would like to show the time on the
form in the textbox named clock1 as soon as the form is opened and have it stay up the whole time until the form is closed. This is what I have tried. It doesn't seem to do anything. Sub RClock1() Clock1.Text = CDbl(Time) ' Set up the next event one second from now NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub I have the code in the code section for userform1. Any ideas. Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
clock on user form
Insert a module and paste the below code..
Sub Main() Load UserForm1 UserForm1.Show End Sub In Code section of Userform Private Sub UserForm_Activate() RClock1 End Sub Sub RClock1() UserForm1.Clock1.Text = Format(Now, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: I have set up a user form (userform1) and would like to show the time on the form in the textbox named clock1 as soon as the form is opened and have it stay up the whole time until the form is closed. This is what I have tried. It doesn't seem to do anything. Sub RClock1() Clock1.Text = CDbl(Time) ' Set up the next event one second from now NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub I have the code in the code section for userform1. Any ideas. Thanks |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
clock on user form
Jacob,
I did what you said. It gets the time into the textbox (a lot more than I could do) but it does not change. The time just stays at the time you start the form it does not tick. Any more ideas. Thanks "Jacob Skaria" wrote: Insert a module and paste the below code.. Sub Main() Load UserForm1 UserForm1.Show End Sub In Code section of Userform Private Sub UserForm_Activate() RClock1 End Sub Sub RClock1() UserForm1.Clock1.Text = Format(Now, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: I have set up a user form (userform1) and would like to show the time on the form in the textbox named clock1 as soon as the form is opened and have it stay up the whole time until the form is closed. This is what I have tried. It doesn't seem to do anything. Sub RClock1() Clock1.Text = CDbl(Time) ' Set up the next event one second from now NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub I have the code in the code section for userform1. Any ideas. Thanks |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
clock on user form
Oops..
In the module paste the below code.. Sub Macro1() Load UserForm1 UserForm1.Show End Sub Sub RClock1() UserForm1.Clock1.Text = Format(Now, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub In Code section of Userform..paste the below Private Sub UserForm_Activate() Call RClock1 End Sub and run macro1 from MacroList If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: Jacob, I did what you said. It gets the time into the textbox (a lot more than I could do) but it does not change. The time just stays at the time you start the form it does not tick. Any more ideas. Thanks "Jacob Skaria" wrote: Insert a module and paste the below code.. Sub Main() Load UserForm1 UserForm1.Show End Sub In Code section of Userform Private Sub UserForm_Activate() RClock1 End Sub Sub RClock1() UserForm1.Clock1.Text = Format(Now, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: I have set up a user form (userform1) and would like to show the time on the form in the textbox named clock1 as soon as the form is opened and have it stay up the whole time until the form is closed. This is what I have tried. It doesn't seem to do anything. Sub RClock1() Clock1.Text = CDbl(Time) ' Set up the next event one second from now NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub I have the code in the code section for userform1. Any ideas. Thanks |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
clock on user form
Jacob,
Worked a treat but I did not tell you the full story as I thought the changes required would be easy. Should have known. What I really want is the time since the race started in the text box. This is equal to Now - start time. The start time is stored in cell b6 in sheet "Timing Sheet". This is what I thought would work Sub RClock1() Watch = Now - sheets("timing sheet").cell("b6") UserForm1.Clock1.Text = Format(Watch, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub I should have known it wouldn't be that easy. Yet again, please show me how to fix it. Thanks "Jacob Skaria" wrote: Oops.. In the module paste the below code.. Sub Macro1() Load UserForm1 UserForm1.Show End Sub Sub RClock1() UserForm1.Clock1.Text = Format(Now, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub In Code section of Userform..paste the below Private Sub UserForm_Activate() Call RClock1 End Sub and run macro1 from MacroList If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: Jacob, I did what you said. It gets the time into the textbox (a lot more than I could do) but it does not change. The time just stays at the time you start the form it does not tick. Any more ideas. Thanks "Jacob Skaria" wrote: Insert a module and paste the below code.. Sub Main() Load UserForm1 UserForm1.Show End Sub In Code section of Userform Private Sub UserForm_Activate() RClock1 End Sub Sub RClock1() UserForm1.Clock1.Text = Format(Now, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: I have set up a user form (userform1) and would like to show the time on the form in the textbox named clock1 as soon as the form is opened and have it stay up the whole time until the form is closed. This is what I have tried. It doesn't seem to do anything. Sub RClock1() Clock1.Text = CDbl(Time) ' Set up the next event one second from now NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub I have the code in the code section for userform1. Any ideas. Thanks |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
clock on user form
Got it to work.
Sub RClock1() Start = Sheets("Timing Sheet").Range("b6") Watch = Now - Start UserForm1.RaceClock1.Text = Format(Watch, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub Cracked it. Thank you. "NDBC" wrote: Jacob, Worked a treat but I did not tell you the full story as I thought the changes required would be easy. Should have known. What I really want is the time since the race started in the text box. This is equal to Now - start time. The start time is stored in cell b6 in sheet "Timing Sheet". This is what I thought would work Sub RClock1() Watch = Now - sheets("timing sheet").cell("b6") UserForm1.Clock1.Text = Format(Watch, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub I should have known it wouldn't be that easy. Yet again, please show me how to fix it. Thanks "Jacob Skaria" wrote: Oops.. In the module paste the below code.. Sub Macro1() Load UserForm1 UserForm1.Show End Sub Sub RClock1() UserForm1.Clock1.Text = Format(Now, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub In Code section of Userform..paste the below Private Sub UserForm_Activate() Call RClock1 End Sub and run macro1 from MacroList If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: Jacob, I did what you said. It gets the time into the textbox (a lot more than I could do) but it does not change. The time just stays at the time you start the form it does not tick. Any more ideas. Thanks "Jacob Skaria" wrote: Insert a module and paste the below code.. Sub Main() Load UserForm1 UserForm1.Show End Sub In Code section of Userform Private Sub UserForm_Activate() RClock1 End Sub Sub RClock1() UserForm1.Clock1.Text = Format(Now, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: I have set up a user form (userform1) and would like to show the time on the form in the textbox named clock1 as soon as the form is opened and have it stay up the whole time until the form is closed. This is what I have tried. It doesn't seem to do anything. Sub RClock1() Clock1.Text = CDbl(Time) ' Set up the next event one second from now NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub I have the code in the code section for userform1. Any ideas. Thanks |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
clock on user form
I am not sure how this will affect your other routines. This should work
Sub RClock1() Watch = Now - Sheets("timing sheet").Range("b6") UserForm1.Clock1.Text = Format(Watch, "hh:mm:ss") Application.OnTime Now + TimeValue("00:00:01"), "RClock1" End Sub If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: Jacob, Worked a treat but I did not tell you the full story as I thought the changes required would be easy. Should have known. What I really want is the time since the race started in the text box. This is equal to Now - start time. The start time is stored in cell b6 in sheet "Timing Sheet". This is what I thought would work Sub RClock1() Watch = Now - sheets("timing sheet").cell("b6") UserForm1.Clock1.Text = Format(Watch, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub I should have known it wouldn't be that easy. Yet again, please show me how to fix it. Thanks "Jacob Skaria" wrote: Oops.. In the module paste the below code.. Sub Macro1() Load UserForm1 UserForm1.Show End Sub Sub RClock1() UserForm1.Clock1.Text = Format(Now, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub In Code section of Userform..paste the below Private Sub UserForm_Activate() Call RClock1 End Sub and run macro1 from MacroList If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: Jacob, I did what you said. It gets the time into the textbox (a lot more than I could do) but it does not change. The time just stays at the time you start the form it does not tick. Any more ideas. Thanks "Jacob Skaria" wrote: Insert a module and paste the below code.. Sub Main() Load UserForm1 UserForm1.Show End Sub In Code section of Userform Private Sub UserForm_Activate() RClock1 End Sub Sub RClock1() UserForm1.Clock1.Text = Format(Now, "hh:mm:ss") UserForm1.Repaint NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub If this post helps click Yes --------------- Jacob Skaria "NDBC" wrote: I have set up a user form (userform1) and would like to show the time on the form in the textbox named clock1 as soon as the form is opened and have it stay up the whole time until the form is closed. This is what I have tried. It doesn't seem to do anything. Sub RClock1() Clock1.Text = CDbl(Time) ' Set up the next event one second from now NextTick = Now + TimeValue("00:00:01") Application.OnTime NextTick, "RClock1" End Sub I have the code in the code section for userform1. Any ideas. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Incremental time values based upon clock in and clock out times | Excel Discussion (Misc queries) | |||
How do I calculate time in excel (clock in and clock out | Excel Discussion (Misc queries) | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
Change EXCEL Clock to Standard Clock or Military Time | Excel Worksheet Functions | |||
User Form | Excel Discussion (Misc queries) |