+ Reply to Thread
Results 1 to 2 of 2

Help: Multiple Live Timer (VBA Macro)

  1. #1
    Registered User
    Join Date
    11-11-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    4

    Help: Multiple Live Timer (VBA Macro)

    Hi,

    LiveTime.jpg

    May I know what will be the VBA code to script the following:

    1. When I enter a time value on cell B4, the timer shall start running live on C4.
    2. When I click the stop button on D4, the live timer on C4 will stop and results will be reflected on E4 I.e. Results is from NOW() minus B4
    3. When time hits 1hr 30 mins, it will show amber, 2 hrs show red, less than 1hr 30mins show green.

    I tried to use simple OnTime() method but doesn't achieve the desired outcome. Moreover I can't seem to find a code for the button to stop the timer for the individual row and reflect the results.

    Please advise.

    C4 Formula is =TIMEVALUE(HOUR($B$1-B4)&":"&MINUTE($B$1-B4)&":"&SECOND($B$1-B4))

    Please Login or Register  to view this content.
    Thank you.
    Last edited by Fotis1991; 02-27-2014 at 11:01 AM. Reason: pls use code tags

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

    Re: Help: Multiple Live Timer (VBA Macro)

    Hi,

    Most interesting problem. I was able to solve your problem using 5 timers. The main timer (Timer 0) is the time of day timer which runs once a second. The other 4 timers are used only to schedule the 'START' for each timer based on the time of day each timer is supposed to start. After the other timers run once, they are no longer needed. After Timer 1 thru 4 starts, then each becomes a 'stop watch' and can be polled to update the elapsed time by the 'Timer 0' loop.

    By using only 'Timer 0', it solves your STOP problem. When the 'Stop' command button is pressed, a software flag is set so that 'stop watch' is no longer active.

    Please forgive me, as I got carried away a little and added a few features. If you don't like any of them and are not able to remove them yourself, I will gladly remove the unwanted features for you which include:
    a. A UserForm to change the 'Start Times'.
    b. Additional color coding

    Lewis
    Attached Files Attached Files

+ 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. Excel Live VLookup Live in spreadsheet - Quick way to find them?
    By CHR15T1N4 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2013, 07:33 AM
  2. View a spreadsheet live with multiple users
    By antmcg12 in forum Excel General
    Replies: 0
    Last Post: 01-30-2013, 10:39 AM
  3. Replies: 1
    Last Post: 12-12-2012, 08:46 PM
  4. How to stamp live time and run a timer after triggered by an event?
    By pkaspa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2008, 01:21 PM
  5. [SOLVED] Stopping a Timer / Running a timer simultaneously on Excel
    By Paul23 in forum Excel General
    Replies: 1
    Last Post: 03-10-2006, 08:10 AM

Tags for this Thread

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