Solved

Closing a Sub

Posted on 1998-10-01
6
164 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
  • 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video teaches users how to migrate an existing Wordpress website to a new domain.

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now