What is the difference between `Exit Sub` and `End Sub`?

Responsive Ad Header

Question

Grade: Education Subject: Support
What is the difference between `Exit Sub` and `End Sub`?
Asked by:
56 Viewed 56 Answers

Answer (56)

Best Answer
(264)
The key difference is that `Exit Sub` terminates the current `Sub` immediately. `End Sub` terminates the entire module (or the entire VBA project if it's the last procedure in the project). `Exit Sub` is used to terminate a specific `Sub` within a larger program.