I suspect use of Exit Sub is when there is more than 1 action after an IF test, e.g.
Code:
Sub Macro1()
Range("A1").Select
If Range("A2").Value = 0 Then MsgBox "No Data"
Range("A3").Select
End Sub
Here the message box will display only if A2 contains 0. Regardless of what A2 contains, the selected cell
will be A3 before the procedure ends.
Code:
Sub Macro2()
Range("A1").Select
If Range("A2").Value = 0 Then
MsgBox "No Data"
Exit Sub
End If
Range("A3").Select
End Sub
Here, A1 will be the selected cell (and msgbox will display),
after the macro has run, only if A2 does contains 0 as you are forcing the procedure to exit before it is finished.
However, if A2 does
not contain 0, the If statement won't execute, so you will not see a msgbox and A3 will be the selected cell,
after the macro has run.
If you use F9 to step through each line of code, you should be able to see how they differ, despite appearing to be similar.
This is a simple example but there are lots of situations where you may want to exit a procedure before it finishes (or not) depending on a specified condition, e.g. You're in one procedure, which calls another.. you may want to exit that called procedure to return to the first one or you may want the called procedure to finish completely before returning to the first procedure. e.g.
Code:
Sub Main()
Range("A1").Select
If Range("A1").Value = "Summarise" Then
Call Summarise_1
End If
End Sub
Sub Summarise_1()
'Some code
If Range("B1").Value = 0 Then
Exit Sub
Else
Range("A1").Value = "Complete"
End If
End Sub
The value of A1 will never be "Complete" if Range("B1") contains a value of 0 (and it isn't initially shown as "Complete"