I am working on a project using forms in excel. I need to have the
time updated in the caption on the form. So, as each second passess
I need to be able to see that. Please help!
Thanks
Andrew
I am working on a project using forms in excel. I need to have the
time updated in the caption on the form. So, as each second passess
I need to be able to see that. Please help!
Thanks
Andrew
Does this help?
http://www.xtremevbtalk.com/archive/.../t-214279.html
OJ
Try this,
Put below code into form's code module.
Dim TimeUpdate As Boolean
Private Sub UserForm_Activate()
TimeUpdate = True
Do
DoEvents
If TimeUpdate Then
Me.Caption = Time
Else
Exit Sub
End If
Loop
End Sub
Private Sub UserForm_Terminate()
TimeUpdate = False
End Sub
Regards,
Shah Shailesh
http://members.lycos.co.uk/shahweb/
(Excel Add-ins)
*** Sent via Developersdex http://www.developersdex.com ***
you'll need to use a timer control that fires every second. There are quite a
few ActiveX controls that do this .. do a google search..
Updateing the caption is simplistic
Private Sub UserForm_Click()
UpdateDaption
End Sub
Sub UpdateDaption()
Me.Caption = "Time: " & Format$(Now, "HH:MM:SS")
End Sub
http://uk.builder.com/downloads/0,39...tm?query=timer
HTH
to test the sub, I used the userform's click evnt to call the caption update
routine
"jarosinski2" wrote:
> I am working on a project using forms in excel. I need to have the
> time updated in the caption on the form. So, as each second passess
> I need to be able to see that. Please help!
>
> Thanks
> Andrew
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks