N
N+
hi all !
i have a cyclic vbe program that bob gave to me and it works fine..
but i need to open it in more than one windows simoultaneously, and when i
switch to window 2, the timer in the window 1 stops !!
maybe someone can suggest me how to do!
this is the code:
TIMER
Add this to a standard code module
Option Explicit
Public nTime As Double
Public Sub StartTimer()
On Error Resume Next
Application.OnTime nTime, "RunTimer", , False
On Error GoTo 0
ActiveSheet.Range("A1").Value = 0
RunTimer
End Sub
Public Sub StopTimer()
Application.OnTime nTime, "RunTimer", , False
End Sub
Public Sub RunTimer()
With ActiveSheet.Range("A1")
.Value = .Value + TimeSerial(0, 0, 1)
.NumberFormat = "hh:mm:ss"
End With
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "RunTimer"
End Sub
i have a cyclic vbe program that bob gave to me and it works fine..
but i need to open it in more than one windows simoultaneously, and when i
switch to window 2, the timer in the window 1 stops !!
maybe someone can suggest me how to do!
this is the code:
TIMER
Add this to a standard code module
Option Explicit
Public nTime As Double
Public Sub StartTimer()
On Error Resume Next
Application.OnTime nTime, "RunTimer", , False
On Error GoTo 0
ActiveSheet.Range("A1").Value = 0
RunTimer
End Sub
Public Sub StopTimer()
Application.OnTime nTime, "RunTimer", , False
End Sub
Public Sub RunTimer()
With ActiveSheet.Range("A1")
.Value = .Value + TimeSerial(0, 0, 1)
.NumberFormat = "hh:mm:ss"
End With
nTime = Now + TimeSerial(0, 0, 1)
Application.OnTime nTime, "RunTimer"
End Sub