Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How do you stop a procedure by click another button. I want to be able to
click button2 to stop the procedure being run by button1. Private Sub button1_Click() runingProcedure End Sub Private Sub button2_Click() stop runingProcedure End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Ayo wrote:
How do you stop a procedure by click another button. I want to be able to click button2 to stop the procedure being run by button1. Private Sub button1_Click() runingProcedure End Sub Private Sub button2_Click() stop runingProcedure End Sub One idea: Add a module-level or global variable that will be set in button2_Click. Add code to button1_Click to check the state of this variable in one or more places as needed. It's also a good idea to add DoEvents tactically in the button1_Click code to make sure the click event on button2 is captured appropriately. Also... make sure you do any necessary cleanup in button1_Click so it exits gracefully. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Procedure is too big | Excel Worksheet Functions | |||
VBA Procedure | Excel Discussion (Misc queries) | |||
Urgent - VBA procedure | Excel Discussion (Misc queries) | |||
Very Urgent VBA Procedure | Excel Discussion (Misc queries) |