JLMitchell
New Member
- Joined
- Oct 30, 2005
- Messages
- 4
In addition to the data validation I specified on the cells my users must enter their parameters into, I have a few other things I need to check about their provided input. If their input is "invalid", as determined by my subsequent checks, I want to put up a message box, select the cell they need to change when they click okay on the message box, and stop execution of the macro immediately in my validation sub. I thought that "Exit" would do it, but when I tested it, I found that another programmer error was detected much further through my code after this "exit" occurred, which leads me to believe that the program continued execution and my "exit" didn't do what I thought. Can someone tell me how to immediately cause a macro to stop running in the middle of a sub?
Incidentally, I am VERY new to Excel VBA macros and have not yet picked up a book about it. I learned BASIC 20 years ago and have been a programmer in various languages since then, but I have been out of the industry for 8 years and only play with it now. I got inspired to play with this and taught myself what I could in the last 48 hours just looking on the web and playing with it hands-on, so this is likely a REALLY stupid question that anyone with ANY knowledge could answer. So please forgive me and I promise to buy at least one book on the subject soon!
I refuse to use a "go to", which would be the easy way to force a change in the execution path but goes against everything I have ever been taught since my first experiences with BASIC!
Thanks!
Incidentally, I am VERY new to Excel VBA macros and have not yet picked up a book about it. I learned BASIC 20 years ago and have been a programmer in various languages since then, but I have been out of the industry for 8 years and only play with it now. I got inspired to play with this and taught myself what I could in the last 48 hours just looking on the web and playing with it hands-on, so this is likely a REALLY stupid question that anyone with ANY knowledge could answer. So please forgive me and I promise to buy at least one book on the subject soon!
Thanks!