Ok, so I have built up quite a few macros for automating functions in some spreadsheets, and I want to start being able to detect when errors occur. Right now I just have the function or sub terminate itself if an error occurs, but that just returns control to the calling sub/function.
I need a way to detect if an error occurs, and immedatly terminate the whole process so that it does not continue and make eronious changes further down the line.
I had thought of declaring a pubic boolean variable that i could flip if an error occurs, but I am not sure how to detect this flip without programing in an if statement every time i call a function.
Question1: Is there a way to write a function/sub that will automaticly triger if a public variable becomes a certain value?
Question2: How do I unload a macro (terminate it) from a public function? I have found that for user forms, the Unload Me command does not work in a public function. I suspect this is becasue the function is not directly attached to a form.
Thanks in advance!
Bookmarks