

You just need to make sure you have “Auto Syntax Check” activated in your VB editor. Well, VBA helps you by pointing out these errors by showing an error message. It’s like typos that you do while writing your codes.

While writing VBA code you need to follow a particular Syntax and when you skip it or don’t write it in the way it should be you can face SYNTAX error (also called Language error). To understand VBA error, you can split them into four categories, and below is the explanation of these types of errors. (But, if you’re using objects such as Userforms, this will not highlight the line causing the error in the object but will only highlight the line that’s referring to that object). Break on Unhandled Errors: This is the default setting that helps you to know about all the errors where you are not using any error handling technique and stop the code for all the unhandled errors.

And if you’re using objects such as Userforms, it will also break within those objects and highlight the exact line where the error is. Break-in Class Module: With this option, VBA will stop all your codes that are not handled by any technique.Break on All Errors: If you have this option activated, VBA will stop the code for all types of errors even if you have used all kinds of error handling techniques.
