I want to End Sub if a Call Function fails.
I have a button that Calls a Validation Function and then moves to another tab if the validation passes, but if the validation fails I want the Sub to End and not move to the next tab.
I want to End Sub if a Call Function fails.
I have a button that Calls a Validation Function and then moves to another tab if the validation passes, but if the validation fails I want the Sub to End and not move to the next tab.
Typically, you would define a global Boolean variable. Set it to True or False in the Validation routine, depending on whether or not the validation has passed, the check the variable in the calling routine.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
I got it, thanks a lot!!!
You're welcome.
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
New quick method:
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Or you can use this way:
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks