How to Stop a Function?

S

Shapper

Hello,

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

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

Thanks,
Miguel
 
M

Mythran

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
 
G

Guest

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

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top