Quit UserForm and Procedure
Hi,
I have a Procedure and a UserForm. On the UserForm is the Button "Cancel". When I click this button I would like to quit the UserForm AND stop running the other procedure. Sub test() ' Some Code Call UserForm1 ' Some more Code <-- Do not run when quit UserForm End Sub Unfortunately this doesn't work: Private Sub cmbCancel_Click() Unload Me Exit Sub End Sub What can I do to really leave both? Thank you for helping me. Maria |
Quit UserForm and Procedure
Maria,
Try this Private Sub cmdCancel_Click() Unload Me End End Sub -- HTH RP "Maria" wrote in message ... Hi, I have a Procedure and a UserForm. On the UserForm is the Button "Cancel". When I click this button I would like to quit the UserForm AND stop running the other procedure. Sub test() ' Some Code Call UserForm1 ' Some more Code <-- Do not run when quit UserForm End Sub Unfortunately this doesn't work: Private Sub cmbCancel_Click() Unload Me Exit Sub End Sub What can I do to really leave both? Thank you for helping me. Maria |
Quit UserForm and Procedure
IS this also appropriate and is it equivalent
Me.HIDE Set Userform1 = Nothing Best N10 "Bob Phillips" wrote in message ... Maria, Try this Private Sub cmdCancel_Click() Unload Me End End Sub -- HTH RP "Maria" wrote in message ... Hi, I have a Procedure and a UserForm. On the UserForm is the Button "Cancel". When I click this button I would like to quit the UserForm AND stop running the other procedure. Sub test() ' Some Code Call UserForm1 ' Some more Code <-- Do not run when quit UserForm End Sub Unfortunately this doesn't work: Private Sub cmbCancel_Click() Unload Me Exit Sub End Sub What can I do to really leave both? Thank you for helping me. Maria |
Quit UserForm and Procedure
Hi Bob,
that's it. Thank you. Maria -----Original Message----- Maria, Try this Private Sub cmdCancel_Click() Unload Me End End Sub -- HTH RP "Maria" wrote in message ... Hi, I have a Procedure and a UserForm. On the UserForm is the Button "Cancel". When I click this button I would like to quit the UserForm AND stop running the other procedure. Sub test() ' Some Code Call UserForm1 ' Some more Code <-- Do not run when quit UserForm End Sub Unfortunately this doesn't work: Private Sub cmbCancel_Click() Unload Me Exit Sub End Sub What can I do to really leave both? Thank you for helping me. Maria . |
Quit UserForm and Procedure
NO, the code in the calling procedure still continues after this executed.
-- HTH RP "N10" wrote in message ... IS this also appropriate and is it equivalent Me.HIDE Set Userform1 = Nothing Best N10 "Bob Phillips" wrote in message ... Maria, Try this Private Sub cmdCancel_Click() Unload Me End End Sub -- HTH RP "Maria" wrote in message ... Hi, I have a Procedure and a UserForm. On the UserForm is the Button "Cancel". When I click this button I would like to quit the UserForm AND stop running the other procedure. Sub test() ' Some Code Call UserForm1 ' Some more Code <-- Do not run when quit UserForm End Sub Unfortunately this doesn't work: Private Sub cmbCancel_Click() Unload Me Exit Sub End Sub What can I do to really leave both? Thank you for helping me. Maria |
Quit UserForm and Procedure
Thanks for the calrification Bob
Best N10 "Bob Phillips" wrote in message ... NO, the code in the calling procedure still continues after this executed. -- HTH RP "N10" wrote in message ... IS this also appropriate and is it equivalent Me.HIDE Set Userform1 = Nothing Best N10 "Bob Phillips" wrote in message ... Maria, Try this Private Sub cmdCancel_Click() Unload Me End End Sub -- HTH RP "Maria" wrote in message ... Hi, I have a Procedure and a UserForm. On the UserForm is the Button "Cancel". When I click this button I would like to quit the UserForm AND stop running the other procedure. Sub test() ' Some Code Call UserForm1 ' Some more Code <-- Do not run when quit UserForm End Sub Unfortunately this doesn't work: Private Sub cmbCancel_Click() Unload Me Exit Sub End Sub What can I do to really leave both? Thank you for helping me. Maria |
All times are GMT +1. The time now is 11:03 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com