+ Reply to Thread
Results 1 to 3 of 3

Exiting a Sub

  1. #1
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Question Exiting a Sub

    Hi all, first I'll submit the code and then the problem:

    Please Login or Register  to view this content.
    When I step into the "SourceTransfer" Sub, I have this code to make sure that there has been data inputted into the proper cell:

    Please Login or Register  to view this content.
    If this happens, I want to exit the "IndMthlyExistingMth_Udate" Sub without carrying on to the next line, being:
    Please Login or Register  to view this content.
    I've tried some boolean tests but I cannot make it work once the "SourceTransfer" exits it's Sub. Any Suggestions?
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Exiting a Sub

    Change the sub to a function that returns True if the conditions are satisfied to continue, and test that in the calling routine.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Exiting a Sub

    Thanks shg, I'm going to try that. I have a meeting so I won't be able to right away but as soon as I do I will let you know the outcome. I've yet to work very much with functions, mostly just subs but I'll give it a go!

+ 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