+ Reply to Thread
Results 1 to 5 of 5

Programming a runnig clock

  1. #1
    Registered User
    Join Date
    06-01-2016
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    2

    Programming a runnig clock

    Can anyone tell me why the following clock is not being updated continuously?

    Public Sub Userform_Initialize()

    Call Clock

    End Sub

    Sub Clock()

    Label1.Caption = Time()
    Application.OnTime Now + TimeValue("00:00:01"), "Clock"

    End Sub
    Any help will be appreciated.

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Programming a runnig clock

    Probably because the procedure called by an OnTime statement must be in a standard code module.

  3. #3
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: Programming a runnig clock

    Here's I a version that I found on the internet and have been using for a while. Label1 and the Userform Caption both have working time clocks
    Attached Files Attached Files
    Last edited by meabrams; 06-01-2016 at 05:04 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: Programming a runnig clock

    I'm fascinated: why would anyone need this in an Excel file???
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    06-01-2016
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    2

    Re: Programming a runnig clock

    Quote Originally Posted by meabrams View Post
    Here's I a version that I found on the internet and have been using for a while. Label1 and the Userform Caption both have working time clocks
    Thanks, used it and it works great! Although I don't understand it completely.

    I'm still unclear why Application.OnTime must be run in a core module.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Calculating Allocated Hours Based On Clock In and Clock Out
    By rahul_ferns76 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-15-2016, 07:46 AM
  2. Trying to setup a runnig inventory
    By Excelrooke in forum Excel General
    Replies: 4
    Last Post: 03-09-2014, 01:09 PM
  3. Programming an alarm clock
    By pete123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2008, 02:24 PM
  4. Programming a clock in/out system
    By exsam21 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-26-2005, 12:50 PM
  5. Re: Runnig Excel without visible application
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2005, 05:06 PM
  6. Is runnig.
    By Tom in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-11-2005, 11:06 AM
  7. terminate a runnig macro
    By JH in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2005, 02:06 AM

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