Solved

Closing a Sub

Posted on 1998-10-01
6
168 Views
Last Modified: 2013-12-25
I want this to be done:

Sub Hello(var)
...
For each item in DBC do
...
If var2="end" then
     End Sub
End If
Next
...
End Sub

I get an error when it reaches the "End Sub" in the the "If"-statement since it wants a "End If" first. What can I do to skip this?
0
Comment
Question by:EasyQ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 

Author Comment

by:EasyQ
ID: 1855364
Edited text of question
0
 

Expert Comment

by:shez
ID: 1855365
you may try this:
Sub Hello(var)
    ...
    For each item in DBC do
    ...
    If var2="end" then
         Exit Sub
    End If
    Next
    ...
    End Sub
0
 

Author Comment

by:EasyQ
ID: 1855366
SHAZ. It worked fine! (How could I not know such an easy command) hmm guess it's because I'm self-learned/self-learning. Oh well. If you want your points, just post it as an answer.
As my name says, some thing I ask are EasyQ:s =]


0
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 

Accepted Solution

by:
shez earned 60 total points
ID: 1855367
you may try this:
       Sub Hello(var)
           ...
           For each item in DBC do
           ...
           If var2="end" then
                Exit Sub
           End If
           Next
           ...
           End Sub
0
 

Expert Comment

by:shez
ID: 1855368
everything is easy once you know it.
and i'm also self-learned. :)
0
 

Author Comment

by:EasyQ
ID: 1855369
OK thanx again Shez. And hey, I'm sorry for spelling your name with an "A". Now go answer my other questions =] cya
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question