+ Reply to Thread
Results 1 to 4 of 4

Update the time in a form caption

  1. #1
    jarosinski2
    Guest

    Update the time in a form caption

    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


  2. #2
    OJ
    Guest

    Re: Update the time in a form caption

    Does this help?
    http://www.xtremevbtalk.com/archive/.../t-214279.html
    OJ


  3. #3
    Shailesh Shah
    Guest

    Re: Update the time in a form caption

    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 ***

  4. #4
    Patrick Molloy
    Guest

    RE: Update the time in a form caption

    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
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1