How to Stop a Function?

  • Thread starter Thread starter Shapper
  • Start date Start date
S

Shapper

Hello,

Is there a way to stop a function? Something like:

Sub My Function()
...
Stop This Function
...
End Sub

Thanks,
Miguel
 
Shapper said:
Hello,

Is there a way to stop a function? Something like:

Sub My Function()
...
Stop This Function
...
End Sub

Thanks,
Miguel

Yes:

Sub MySub()
Return
End Sub

Or:

Sub MySub()
Exit Sub
End Sub

HTH,
Mythran
 
You can set up a conditional:

If (iNeedtoStop == true) Then
Return
End If

if(iNeedToStop)
return;

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

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