Can you use `Exit Sub` outside of an `On Error` statement?

Responsive Ad Header

Question

Grade: Education Subject: Support
Can you use `Exit Sub` outside of an `On Error` statement?
Asked by:
58 Viewed 58 Answers

Answer (58)

Best Answer
(351)
Yes, `Exit Sub` can be used outside of an `On Error` statement. However, it's generally recommended to use it *within* an `On Error` block to specifically terminate a `Sub` after handling an error. Using it outside of an `On Error` block doesn't inherently prevent errors but can disrupt the flow of execution if an error occurs elsewhere in the code.