+ Reply to Thread
Results 1 to 2 of 2

Edit spreadsheet while VBA timer is running

  1. #1
    Registered User
    Join Date
    06-25-2015
    Location
    Brisbane
    MS-Off Ver
    2010
    Posts
    10

    Edit spreadsheet while VBA timer is running

    Hi people,

    My knowledge of VBA is very limited but i was able to write the following code. I know its ugly but it works. The problem is while the timer is counting down it freezes every time a cell is edited. I believe it is because the code will not run while the spreadsheet is effectively in "edit mode". I there a way around this?

  2. #2
    Registered User
    Join Date
    06-25-2015
    Location
    Brisbane
    MS-Off Ver
    2010
    Posts
    10

    Re: Edit spreadsheet while VBA timer is running

    forgot to attach the code.

    Sub starttimer()
    Application.OnTime Now + TimeValue("00:00:01"), "nexttick"
    If Sheet1.Range("l1") = TimeValue("00:20:00") Then
    Application.Speech.speak (".welcome to the d p r room. Please discuss yesterdays actions")
    End If

    End Sub
    Sub nexttick()
    If Sheet1.Range("l1") = 0 Then Exit Sub
    Sheet1.Range("l1").Value = Sheet1.Range("l1").Value - TimeValue("00:00:01")

    If Sheet1.Range("l1") = TimeValue("00:00:00") Then
    Application.Speech.speak (".Time is now up. Please conclude the meeting and five s the room before departing Thank you")
    ElseIf Sheet1.Range("l1") = TimeValue("00:05:00") Then
    Application.Speech.speak (".Please move on to Productivity")
    ElseIf Sheet1.Range("l1") <= TimeValue("00:05:00") Then
    Sheet1.Shapes("textbox 2").Fill.ForeColor.RGB = RGB(113, 132, 193)
    ElseIf Sheet1.Range("l1") = TimeValue("00:10:00") Then
    Application.Speech.speak (".Please move on to Quality")
    ElseIf Sheet1.Range("l1") <= TimeValue("00:10:00") Then
    Sheet1.Shapes("textbox 2").Fill.ForeColor.RGB = RGB(250, 113, 62)
    ElseIf Sheet1.Range("l1") = TimeValue("00:15:00") Then
    Application.Speech.speak (".Please move on to Safety")
    ElseIf Sheet1.Range("l1") <= TimeValue("00:15:00") Then
    Sheet1.Shapes("textbox 2").Fill.ForeColor.RGB = RGB(251, 201, 60)
    Else
    Sheet1.Shapes("TextBox 2").Fill.ForeColor.RGB = RGB(166, 166, 166)
    End If
    starttimer
    End Sub

    Sub stoptimer()
    On Error Resume Next
    Application.OnTime Now + TimeValue("00:00:01"), "nexttick", , False
    End Sub

+ 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 Timer When Clicking a Button
    By markusvirus in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2016, 04:41 PM
  2. timer stops running sometimes
    By melody10 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2015, 02:38 AM
  3. [SOLVED] Multiple timer for running a workshop.
    By arniej in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-13-2014, 05:51 PM
  4. [SOLVED] running timer in excel
    By Shellybelly in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-16-2013, 10:12 AM
  5. Multiple Timer Running
    By Lightnessg1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2013, 02:29 PM
  6. Create a running timer
    By ajxxx in forum Excel General
    Replies: 9
    Last Post: 07-23-2009, 08:48 AM
  7. [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

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