+ Reply to Thread
Results 1 to 5 of 5

Will I run into any problem by exiting out of an IF...Then statement?

  1. #1
    Forum Contributor
    Join Date
    05-02-2013
    Location
    Indiana
    MS-Off Ver
    Microsoft 365 (Subscription)
    Posts
    192

    Will I run into any problem by exiting out of an IF...Then statement?

    I know it is frowned upon, but I would like to exit out of an If...Then statement if a condition is true. Will this cause me any problems down the road if I don't properly exiting with the End If.

    Please Login or Register  to view this content.
    Thanks for your response!

    Last edited by redsab; 06-16-2013 at 09:46 PM.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Will I run into any problem by exiting out of an IF...Then statement?

    that won't cause problems on its own but if you use it a lot in a routine you'll end up with code that is hard to follow. why not use
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646
    Perhaps just Exit Sub.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    05-02-2013
    Location
    Indiana
    MS-Off Ver
    Microsoft 365 (Subscription)
    Posts
    192

    Re: Will I run into any problem by exiting out of an IF...Then statement?

    Yes, that is basically what I want to do. If no product, then exit subroutine. I will use that, thanks!

  5. #5
    Forum Contributor
    Join Date
    05-02-2013
    Location
    Indiana
    MS-Off Ver
    Microsoft 365 (Subscription)
    Posts
    192

    Re: Will I run into any problem by exiting out of an IF...Then statement?

    That would not exactly work in my coding without changing or adding a lot of additional code. You did however, answer my question! I will keep that in mind on my next project!

    Thanks,
    redsab

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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