The macro only works when placed into a module, ive still not found a a way to get around this, would appreciate if you could help solve this issue and also get the macro to start when the file is open:
The following code is placed in a module:
Dim TimerActive As Boolean
Sub StartTimer()
Start_Timer
End Sub
Private Sub Start_Timer()
TimerActive = True
Application.OnTime Now() + TimeValue("00:00:01"), "Timer"
End Sub
Private Sub Stop_Timer()
TimerActive = False
End Sub
Private Sub Timer()
If TimerActive Then
ActiveSheet.Cells(2, 2).Value = Time
Application.OnTime Now() + TimeValue("00:00:01"), "Timer"
End If
End Sub
Thanks in advance..
The following code is placed in a module:
Dim TimerActive As Boolean
Sub StartTimer()
Start_Timer
End Sub
Private Sub Start_Timer()
TimerActive = True
Application.OnTime Now() + TimeValue("00:00:01"), "Timer"
End Sub
Private Sub Stop_Timer()
TimerActive = False
End Sub
Private Sub Timer()
If TimerActive Then
ActiveSheet.Cells(2, 2).Value = Time
Application.OnTime Now() + TimeValue("00:00:01"), "Timer"
End If
End Sub
Thanks in advance..