+ Reply to Thread
Results 1 to 6 of 6

Timer Stop when other CommandButton Clicked

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    187

    Red face Timer Stop when other CommandButton Clicked

    Hi,

    I have the code as below.
    How to keep the timer still running even though other CommandButton is cliked?
    Thanks in advanced for your helps and support.
    Private Sub CommandButton1_Click()
    Dim PauseTime, Start, Finish, TotalTime, MyTime
    Do
        Start = Timer
        DoEvents
        Sheet1.[C3] = Start
    Loop
    End Sub
    
    Private Sub CommandButton2_Click()
    Dim PauseTime, Start, Finish, TotalTime, MyTime
    Do
        Start = Timer
        DoEvents
        Sheet1.[C13] = Start
    Loop
    End Sub

    Regards,
    Iqballhud

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

    Re: Timer Stop when other CommandButton Clicked

    I hope when it reaches the End Sub then the Timer() will get cleared from memory


    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
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: Timer Stop when other CommandButton Clicked

    Is there any way to use timer (then convert to numeric) with the good way, please?
    Because I would like to use timer as based of calculation.

    Regards,
    Iqballhud

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

    Re: Timer Stop when other CommandButton Clicked

    Not sure whether this is a valid suggestion, what about storing the start time in a Module level variable and you can access it later on since it will be kept in memory until the file getting closed?

  5. #5
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: Timer Stop when other CommandButton Clicked

    Hi Sixtsnse,
    I will take your advice..but I don't know exactly how to write the code as your suggestion.
    I'm not expert on this field, if you don't mind please share some code/idea that i can use it, please.

  6. #6
    Forum Contributor
    Join Date
    11-17-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: Timer Stop when other CommandButton Clicked

    Hi Sixtsnse,
    I will take your advice..but I don't know exactly how to write the code as your suggestion.
    I'm not expert on this field, if you don't mind please share some code/idea that i can use it, please.

+ 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. Determine if Commandbutton is clicked
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-06-2014, 03:10 PM
  2. Start/Stop timer
    By JonathanB2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2014, 07:00 AM
  3. how to stop a macro timer running more then once
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-06-2013, 08:58 PM
  4. [SOLVED] Timer non-stop to run?
    By alee001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2013, 03:46 PM
  5. Replies: 1
    Last Post: 12-12-2012, 08:46 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