+ Reply to Thread
Results 1 to 4 of 4

Stopwatch Macro

  1. #1
    Registered User
    Join Date
    01-29-2018
    Location
    India
    MS-Off Ver
    2010
    Posts
    2

    Stopwatch Macro

    Hi,

    I've created a stopwatch using this (https://www.extendoffice.com/documen...stopwatch.html) tutorial and it works perfectly.
    I would like to add another function to this.
    Is it possible to automatically stop the timer when the screen locks and start the timer automatically when we unlock the computer?

    Regards,
    Vivek Nath

  2. #2
    Valued Forum Contributor
    Join Date
    03-16-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    371

    Re: Stopwatch Macro

    You can use the following code to check if your system is Locked or Unlocked (I just checked it and it works). Incorporate it into your timer and you can achieve the function you want.

    Code credit (https://www.mrexcel.com/forum/micros...using-vba.html)
    Please Login or Register  to view this content.
    Design everything to be as simple as possible, but no simpler.

  3. #3
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: Stopwatch Macro

    I got it to stop upon screen lock, but you must manually restart after you unlock:
    the variable: gbWasRunning ,was to detect if you were actually running the timer at lock. If unlock and running, then restart, but nothing tells excel to look after unlock.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-29-2018
    Location
    India
    MS-Off Ver
    2010
    Posts
    2

    Re: Stopwatch Macro

    I tried your code but it seems not working.
    Timer is not starting when I click on Start button.

+ 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. Macro excel stopwatch
    By johnsmith100 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2015, 04:00 AM
  2. Cannot open other files while running stopwatch macro
    By isabela1214 in forum Hello..Introduce yourself
    Replies: 8
    Last Post: 09-03-2015, 12:00 AM
  3. Stopwatch macro on YouTube issue
    By Micbrook in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2015, 02:10 PM
  4. Adding a stopwatch with lap times using a macro
    By tb13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-16-2014, 09:21 PM
  5. Formatting stopwatch-macro output to mm:ss.s
    By Karrock in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-03-2013, 01:02 PM
  6. [SOLVED] VBA/Macro Timer-Stopwatch-Countdown
    By jaddie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2013, 01:44 PM
  7. stopwatch macro for multiple tasks
    By blumbergh12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2010, 02:56 PM

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