mrmcmillanrevis
New Member
- Joined
- Jul 17, 2013
- Messages
- 10
I have a Sub Routine to help users add a new tab to a spreadsheet. It starts by opening a userform where they enter the name of the new tab. The userform then closes and the VBA then searches to see if there is already a tab with that name - if there is the user gets a message to say it already exists and the sub stops. If there is not already a tab with that name, they then see a new Userform asking for more information. There are then a couple more steps which are needed before creating the new tab. However, I've noticed that if the user clicks the 'red X' to close any of the userforms, the Sub Routine carries on running and this leads to some incomplete information being entered.
So, my question is - what do I need to do so that if the user clicks the red X in any of the user forms it effectively jumps back to the main Sub and tells it to just stop running completely?
I am very new to userforms, so am just learning.
It feels like there should be something that effectively says "IF the 'red X' is clicked in this userform then stop the whole sub"
Many Thanks
So, my question is - what do I need to do so that if the user clicks the red X in any of the user forms it effectively jumps back to the main Sub and tells it to just stop running completely?
I am very new to userforms, so am just learning.
It feels like there should be something that effectively says "IF the 'red X' is clicked in this userform then stop the whole sub"
Many Thanks