I am curious if Exit Sub, Exit Function
, among others should be avoided when coding? I have read in various places that it is a bad practice and that you should, if possible, avoid it.
I have provided a function below to demonstrate what I mean:
Function Test()
Dim X As Integer
X = 5
If X = 10 Then
Test = True
Exit Function
Else
Test = False
Exit Function
End If
End Function
In the case above, the
Exit Function
isn't necessary since the entire code will be able to finish the entire routine without an issue. But by adding it, will it cause some issues?