+ Reply to Thread
Results 1 to 2 of 2

Running Clock Problem

  1. #1
    Registered User
    Join Date
    09-30-2013
    Location
    Israel
    MS-Off Ver
    Excel 2010
    Posts
    9

    Running Clock Problem

    Hi!

    I used the next code to have a running clock in one of my workbooks:

    In Module1:

    Dim TimerActive As Boolean
    Sub StartTimer()
    Start_Timer
    End Sub
    Private Sub Start_Timer()
    TimerActive = True
    Application.OnTime Now() + TimeValue("00:00:30"), "Timer"
    End Sub
    Private Sub Stop_Timer()
    TimerActive = False
    End Sub
    Private Sub Timer()
    If TimerActive Then
    ActiveSheet.Cells(2, 4).Value = Time
    Application.OnTime Now() + TimeValue("00:00:30"), "Timer"
    End If
    End Sub


    and as ThisWorkbook:

    Private Sub Workbook_Open()
    Module1.StartTimer
    End Sub




    The Problem is that now, when the workbook is closed and another excel is running, every time when the clock is update (I assume) it opens up the workbook with the clock. How do I stop it?

    Another question is - how do I limit the presence of the clock to a specific worksheet. after setting the running clock it appeared all over the workbook, in every single sheet.

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

    Re: Running Clock Problem

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)


    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

+ 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. Running clock in excel 2010
    By Rhett21 in forum Excel General
    Replies: 1
    Last Post: 10-22-2012, 12:18 PM
  2. Excel 2008 : Running clock, but can't use macros
    By dljhwk11 in forum Excel General
    Replies: 1
    Last Post: 05-22-2011, 03:02 PM
  3. Inserting a Running Clock Cell counting down
    By Dedes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2011, 06:17 AM
  4. Inserting a Running Clock Cell
    By rencol in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-19-2011, 01:48 AM
  5. Replies: 1
    Last Post: 12-17-2005, 05:50 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