Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default live time on userform or within frame


Its easy to display the date and time in a userform but is it possible
to have the time, seconds, running live in the userform or frame...or
is it just the case of refreshing the update within the
frame/userform......mmm but how?

Thanks Theuns


--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile: http://www.excelforum.com/member.php...o&userid=35895
View this thread: http://www.excelforum.com/showthread...hreadid=558411

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default live time on userform or within frame

Here is an example based upon a label on the form to show the time, and two
buttons, one to start it, one to stop it.

This is the userform code

Private Sub CommandButton1_Click()
DisplayTime
End Sub

Private Sub CommandButton2_Click()
Application.OnTime nTime, "DisplayTime", , False
End Sub

and in a standrad code module

Public nTime As Double

Sub DisplayTime()
UserForm1.Label1 = Format(Now(), "dd mmm yyyy hh:mm:ss")
nTime = Now() + TimeSerial(0, 0, 1)
Application.OnTime nTime, "DisplayTime"
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"T.c.Goosen1977"
wrote in
message news:T.c.Goosen1977.2ah4ap_1152105008.604@excelfor um-nospam.com...

Its easy to display the date and time in a userform but is it possible
to have the time, seconds, running live in the userform or frame...or
is it just the case of refreshing the update within the
frame/userform......mmm but how?

Thanks Theuns


--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile:

http://www.excelforum.com/member.php...o&userid=35895
View this thread: http://www.excelforum.com/showthread...hreadid=558411



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default live time on userform or within frame


100% that's what i was looking for....

Thanks
Theuns


--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile: http://www.excelforum.com/member.php...o&userid=35895
View this thread: http://www.excelforum.com/showthread...hreadid=558411

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default live time on userform or within frame


if i use your code bob it's working but it's only showing me the date
not the time?


--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile: http://www.excelforum.com/member.php...o&userid=35895
View this thread: http://www.excelforum.com/showthread...hreadid=558411

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default live time on userform or within frame

make your textbox bigger, or edit the format so it shows what you want

T.c.Goosen1977 wrote:
100% that's what i was looking for....

Thanks
Theuns


--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile: http://www.excelforum.com/member.php...o&userid=35895
View this thread: http://www.excelforum.com/showthread...hreadid=558411




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default live time on userform or within frame

Your textbox must be too small, the format outputs time as well.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"T.c.Goosen1977"
<T.c.Goosen1977.2ah7jg_1152109210.2266@excelforu m-nospam.com wrote in
message news:T.c.Goosen1977.2ah7jg_1152109210.2266@excelfo rum-nospam.com...

if i use your code bob it's working but it's only showing me the date
not the time?


--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile:

http://www.excelforum.com/member.php...o&userid=35895
View this thread: http://www.excelforum.com/showthread...hreadid=558411



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default live time on userform or within frame


yes, you're right...the text box was to small...i see that the time is
current but not live...is it a lot more work to get the time running
live within the form..or do i need to install some special .dll time
file to make the second run live?


--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile: http://www.excelforum.com/member.php...o&userid=35895
View this thread: http://www.excelforum.com/showthread...hreadid=558411

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default live time on userform or within frame

Funnily enough, I posted this earlier today



Here is an example based upon a label on the form to show the time, and two
buttons, one to start it, one to stop it.

This is the userform code

Private Sub CommandButton1_Click()
DisplayTime
End Sub

Private Sub CommandButton2_Click()
Application.OnTime nTime, "DisplayTime", , False
End Sub

and in a standrad code module

Public nTime As Double

Sub DisplayTime()
UserForm1.Label1 = Format(Now(), "dd mmm yyyy hh:mm:ss")
nTime = Now() + TimeSerial(0, 0, 1)
Application.OnTime nTime, "DisplayTime"
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"T.c.Goosen1977"
<T.c.Goosen1977.2ah8xd_1152111008.2589@excelforu m-nospam.com wrote in
message news:T.c.Goosen1977.2ah8xd_1152111008.2589@excelfo rum-nospam.com...

yes, you're right...the text box was to small...i see that the time is
current but not live...is it a lot more work to get the time running
live within the form..or do i need to install some special .dll time
file to make the second run live?


--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile:

http://www.excelforum.com/member.php...o&userid=35895
View this thread: http://www.excelforum.com/showthread...hreadid=558411



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default live time on userform or within frame

Sorry about that, it was you I gave it to <vbg

Are you saying the time isn't updating? I can't understand if so, the code
is all about that.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Bob Phillips" wrote in message
...
Funnily enough, I posted this earlier today



Here is an example based upon a label on the form to show the time, and

two
buttons, one to start it, one to stop it.

This is the userform code

Private Sub CommandButton1_Click()
DisplayTime
End Sub

Private Sub CommandButton2_Click()
Application.OnTime nTime, "DisplayTime", , False
End Sub

and in a standrad code module

Public nTime As Double

Sub DisplayTime()
UserForm1.Label1 = Format(Now(), "dd mmm yyyy hh:mm:ss")
nTime = Now() + TimeSerial(0, 0, 1)
Application.OnTime nTime, "DisplayTime"
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"T.c.Goosen1977"
<T.c.Goosen1977.2ah8xd_1152111008.2589@excelforu m-nospam.com wrote in
message

news:T.c.Goosen1977.2ah8xd_1152111008.2589@excelfo rum-nospam.com...

yes, you're right...the text box was to small...i see that the time is
current but not live...is it a lot more work to get the time running
live within the form..or do i need to install some special .dll time
file to make the second run live?


--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile:

http://www.excelforum.com/member.php...o&userid=35895
View this thread:

http://www.excelforum.com/showthread...hreadid=558411





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sow do i make a userform know if a value is true in a frame, then CSUS_CE_Student[_2_] Excel Discussion (Misc queries) 1 May 13th 07 11:30 PM
UserForm with Frame - Problem Fossil_Rock Excel Programming 1 July 28th 05 02:49 PM
Creating Userform Controls on Frame David Myle Excel Programming 2 February 14th 05 02:51 PM
Live chart on Userform Printing OWC10 rci Excel Programming 1 March 2nd 04 10:37 PM
userform frame control Jo[_4_] Excel Programming 2 September 20th 03 12:38 AM


All times are GMT +1. The time now is 11:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"