+ Reply to Thread
Results 1 to 6 of 6

real-time excel clock

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    real-time excel clock

    Is there an efficient way to have a clock in excel show current hour, minute, second and update this every second (basically have a real-time clock)? I have another macro that runs on a timer every minute, and executes anywhere between 2 to 20 seconds after the minute has started, and I'd like this macro not to be interrupted by this real-time clock code, if that's possible.

    Thanks
    You either quit or become really good at it. There are no other choices.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,767

    Re: real-time excel clock

    Surely it will get affected and you cannot have two timers simultaneously. Instead you can include this clock code in your current onTime code itself to take care of both the activities.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: real-time excel clock

    Quote Originally Posted by :) Sixthsense :) View Post
    Surely it will get affected and you cannot have two timers simultaneously. Instead you can include this clock code in your current onTime code itself to take care of both the activities.
    Did you try to post some code? Nothing is showing up.

  4. #4
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: real-time excel clock

    Quote Originally Posted by :) Sixthsense :) View Post
    Surely it will get affected and you cannot have two timers simultaneously. Instead you can include this clock code in your current onTime code itself to take care of both the activities.
    Did you try to post some code? Nothing is showing up.

  5. #5
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: real-time excel clock

    Hi luv2glyd,

    It is possible to use two timers, but each situation is unique, depending on the load put on the CPU. See the attached file which implements both a 'One Timer' and 'Two Timer' solution.

    Advantages of the One Timer Solution.
    a. Only one Timer is used.
    b. With only one asynchronous Event (one Timer), there is no possibility of dueling Timers.
    c. Debugging multiple timers (with the Two Timer Solution) may have technical problems.

    Advantages of the Two Timer Solution.
    a. Each Timer is Independent and the code is probably simpler.
    b. Slightly less (miniscule amount) processing time overhead. One Timer Solution must test whether the Second (less frequent) Timer has expired.
    c. Code for each Timer can be debugged independently.
    d. One Timer Solution may be more difficult to implement, if the 'One Minute Event' takes longer than 'One Second'.

    In the ThisWorkbook code module:
    Please Login or Register  to view this content.
    In Ordinary Code Module ModOneMinuteEvent:
    Please Login or Register  to view this content.

    In Ordinary Code Module ModOneTimer:
    Please Login or Register  to view this content.
    In Ordinary Code Module ModTwoTimers:
    Please Login or Register  to view this content.
    Lewis
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: real-time excel clock

    Lewis - thanks so much for the code. That is a lot to decipher! LOL. I am not that familiar with timer operations just yet, so will have to devote some time to it this weekend. Thanks again for your help!

    PS: Tired to give you rep. points, but the forum said "you have to spread reputation around before giving it to LJMetzger
    again." Silly rules.
    Last edited by luv2glyd; 02-24-2016 at 08:26 PM.

+ 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. I would like a real tiome clock that runs in an Excel cell
    By barefoot4ever in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 12-09-2014, 07:58 PM
  2. [SOLVED] Can't Stop Live Time / Real Time Clock
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-03-2014, 12:39 PM
  3. [SOLVED] Excel Time Clock
    By JRose0303 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-03-2014, 04:52 PM
  4. [SOLVED] Real Time Clock Encountering Error Upon Userform Close
    By Stonesteel15 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-28-2012, 11:51 PM
  5. Real Time Clock in Cell
    By phillija in forum Excel General
    Replies: 3
    Last Post: 04-27-2010, 02:07 PM
  6. how to make excel get time from system clock
    By juntjoo in forum Excel General
    Replies: 2
    Last Post: 05-03-2008, 12:08 AM
  7. [SOLVED] can excel be a time clock or stop watch?
    By Anthony Reynard Chinnis in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 02-15-2006, 01:45 PM

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