Newb VBA question

  • Thread starter Thread starter tlicious
  • Start date Start date
T

tlicious

How do you return from a sub early? I have code that looks like

If x < 5 Then
Return
End If

I get a Return without GoSub error. Coming from a C++ background so I
have no idea what is going on. Thanks.
 
If it is a Sub, then use Exit Sub.

If it is a function, then use Exit Function.

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top