+ Reply to Thread
Results 1 to 3 of 3

IF true then Exit sub ?

  1. #1
    Registered User
    Join Date
    10-31-2008
    Location
    asia
    Posts
    32

    IF true then Exit sub ?

    Hi all,

    Quick Questions. I was looking up Subs on the internet and found this code.

    Please Login or Register  to view this content.
    The "Exit Sub" in the middle of the code, does it exit from the "IF" statement it is in, or the entire "Sub computerArea()?" If it only exits the if statement, how can I make it exit the entire "Sub computerArea()" because I have a code that needs to be exited when the if statemet (in the middle of my code)is true.

    Thank you for your time
    Last edited by VBA Noob; 11-26-2008 at 03:25 AM. Reason: Added code tags as per forum rules

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: IF true then Exit sub ?

    It ends the SUB

    I rather use this function
    Please Login or Register  to view this content.
    results:
    ?computeArea(-3,4)
    0
    ?computeArea(-3,-4)
    0
    ?computeArea(0,4)
    0
    ?computeArea(0,0)
    0
    ?computeArea(4,0)
    0
    ?computeArea(4,8)
    32
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    haitham1984,

    Please read forum rules below before posting again. I've added you're code tags for you this time

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1