Results 1 to 20 of 20

Multiple timers

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-01-2015
    Location
    Kent, England
    MS-Off Ver
    2013
    Posts
    148

    Multiple timers

    Hi All

    I am trying to create a visual dashboard for cleaning times on some equipment at work, I have one working as i want it and moved onto the second one but when i input the data the timers for both start going super fast!
    The way it should work is the user opens the form and selects the check box against which the item that has been cleaned. this should then set the timer to 10mins and start it. This works ok if only one timer is selected but if both are the timer runs fast, what we should be able to do is select any number of check boxes and or go back to the form and enter another item.

    Timer Code
    Sub starttimer()
    
    Application.OnTime Now + TimeValue("00:00:01"), "D56timer"
    Application.OnTime Now + TimeValue("00:00:01"), "D57timer"
    
    End Sub
    
    Sub D56timer()
    If Sheet1.Range("B1") = Sheet1.Range("B2") Then Exit Sub
    Sheet1.Range("B1").Value = CDate(Sheet1.Range("b1").Value) + TimeValue("00:00:01")
    Sheet1.Range("B1").Value = Application.WorksheetFunction.Text(Sheet1.Range("B1").Value, "[h]:mm:ss")
    Sheet1.Range("C1").NumberFormat = "[ss]"
    starttimer
    
        
    End Sub
    
    Sub D57timer()
    If Sheet1.Range("B4") = Sheet1.Range("B5") Then Exit Sub
    Sheet1.Range("B4").Value = CDate(Sheet1.Range("b4").Value) + TimeValue("00:00:01")
    Sheet1.Range("B4").Value = Application.WorksheetFunction.Text(Sheet1.Range("B4").Value, "[h]:mm:ss")
    Sheet1.Range("C4").NumberFormat = "[ss]"
    starttimer
    
    
        
    End Sub
    
    Sub stoptimer()
    On Error Resume Next
    Application.OnTime Now + TimeValue("00:00:01"), "D56timer", , False
    Application.OnTime Now + TimeValue("00:00:01"), "D57timer", , False
    
    
    End Sub

    Data transfer code
    Private Sub CommandButton1_Click()
    
    Dim TR As Long
    
    TR = Sheet4.Range("B4").Value + 1
    
    
    Sheet3.Range("Data_Start").Offset(TR, 0).Value = Label10
    Sheet3.Range("Data_Start").Offset(TR, 1).Value = Label9
    
    
    'D56
        If Chk_D56CIP.Value = True Then
            Sheet1.Range("B1").Value = "00:00:00"
            Sheet3.Range("Data_Start").Offset(TR, 3).Value = "CIP"
            Sheet3.Range("Data_Start").Offset(TR, 2).Value = Label1
            Sheet3.Range("N2").Value = "00:10:00"
            Call D56timer
            End If
        
        
    'D57
        If Chk_D57CIP.Value = True Then
            Sheet1.Range("B4").Value = "00:00:00"
            Sheet3.Range("Data_Start").Offset(TR, 3).Value = "CIP"
            Sheet3.Range("Data_Start").Offset(TR, 2).Value = Label1
            Sheet3.Range("N3").Value = "00:10:00"
            Call D57timer
            End If
     
       
    Unload UserForm1
    
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Best way to make multiple countdown timers
    By Dave_ross in forum Excel General
    Replies: 19
    Last Post: 02-04-2019, 05:06 PM
  2. Multiple Countdown timers.
    By dawidski in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-12-2013, 11:42 PM
  3. Need Multiple Stopwatch Timers on Worksheet
    By texas tornado in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2013, 06:37 PM
  4. Multiple Timers within EXcel
    By Janto724 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 04-26-2013, 09:07 AM
  5. multiple countdown timers in excel?
    By hollandrob81 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-06-2013, 04:12 PM
  6. Setup Multiple Timers
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-02-2010, 04:38 PM
  7. Running multiple timers
    By tropy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-17-2006, 09:44 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