Thread: stop a macro
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Zaahir Zaahir is offline
external usenet poster
 
Posts: 35
Default stop a macro

hi

i have the ffg macro that uses a label and display it as a clock......
the problem is after the application quits the macro continues and the
program re-executes.

the code is below...............

Sub clock()
If ThisWorkbook.Sheets("Client Info").Range("b3").Value = "x" Then Exit Sub
frmMainFrame.lblTime.Caption = Format(Now, "hh:mm:ss AM/PM")
Application.OnTime Now + TimeSerial(0, 0, 1), "clock"
End Sub

the first line of code shud stop the macro bt doesn't

is there a better manner of doing this?
Please Help
thanx in advanced!!!