+ Reply to Thread
Results 1 to 4 of 4

goto nloop inside higher level sub

  1. #1
    Forum Contributor
    Join Date
    07-13-2015
    Location
    Poland
    MS-Off Ver
    MS Office 365
    Posts
    174

    goto nloop inside higher level sub

    how to write 'goto nloop' which is inside higher level sub, when my condition is true in sub_2 and I do not wanna run sub_3 ?


    Please Login or Register  to view this content.

  2. #2
    Forum Contributor S O's Avatar
    Join Date
    06-25-2015
    Location
    England
    MS-Off Ver
    Office 2010 + 2013 + 2016
    Posts
    103

    Re: goto nloop inside higher level sub

    You can't do this. You will need to use a public variable and a conditional statement of some kind like so:

    Please Login or Register  to view this content.
    (also no need to use the "Call" keyword, it's legacy code and not required anymore in VBA.)

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: goto nloop inside higher level sub

    You could have Sub2 call Sub3 if not True
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 10-12-2015 at 03:48 PM. Reason: Added Code Tags
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Contributor
    Join Date
    07-13-2015
    Location
    Poland
    MS-Off Ver
    MS Office 365
    Posts
    174

    Re: goto nloop inside higher level sub

    thanks but I have 1 main macro and about 10 macros which are inside.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    I need to add instructions in all these 10 macros to start my main macro from the begining when condition is true.
    Last edited by zico8; 10-12-2015 at 08:53 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Change one number in a cell inside a formula to a variable that is getting higher (+1)
    By chablo309 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-06-2015, 07:28 AM
  2. Replies: 2
    Last Post: 06-19-2014, 10:39 PM
  3. How to adjust higher level of axis label
    By vietdieu in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-16-2013, 08:33 AM
  4. Passing errors in functions or subs to a higher level
    By baxxie in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-07-2012, 06:51 AM
  5. Replies: 2
    Last Post: 11-14-2011, 06:22 PM
  6. Replies: 2
    Last Post: 05-31-2010, 03:23 PM
  7. [SOLVED] Can I place "On Error GOTO xxx" into module level?
    By Frederick Chow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2006, 12:10 AM

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