ZAX
Well-known Member
- Joined
- Jul 5, 2012
- Messages
- 715
Hello Everyone,
I Have The Following Macros To Start A Timer In Range A1 And they Work perfectly But The Problem Is That they NEVER Stop no matter what I do even if I removed The First code from the Model or if I pressed Esc; The Only way to stop it is to close the whole program 'Excel',The First Macro is Assigned to a Command Button On The Spreadsheet so I need a Macro Called "Stop_Timer" To Assign it to The Second Command Button To Stop The First Macro "Start_Macro"!
I Hope I'm Clear Enough And I Really Appreciate Your Help.
ZAX
I Have The Following Macros To Start A Timer In Range A1 And they Work perfectly But The Problem Is That they NEVER Stop no matter what I do even if I removed The First code from the Model or if I pressed Esc; The Only way to stop it is to close the whole program 'Excel',The First Macro is Assigned to a Command Button On The Spreadsheet so I need a Macro Called "Stop_Timer" To Assign it to The Second Command Button To Stop The First Macro "Start_Macro"!
I Hope I'm Clear Enough And I Really Appreciate Your Help.
ZAX
Code:
Sub Start_Timer()
i = 0
Do
i = i + 1
Application.OnTime DateAdd("s", i, Now), "Add"
Loop
End Sub
Sub Add()
Range("a1").Value = Range("a1").Value + 1
End Sub
Last edited: