Microsoft KB Archive/62255

{| = Excel: Macro Halts After Calling Subroutine Using GOTO =
 * width="100%"|

Last reviewed: November 7, 1994

Article ID: Q62255

SUMMARY
A subroutine (or nested macro) is a macro that is called from another macro. This is a routine that has its own RETURN statement. In Microsoft Excel, using the GOTO command function to call a subroutine causes the macro to stop upon reading the RETURN statement at the end of the subroutine.

To call a subroutine named &quot;Sub&quot; so that it returns to the calling macro, use the following command:

=Sub When Excel reaches the RETURN statement in the subroutine &quot;Sub&quot;, it will return to the next line in the main macro after the command &quot;=Sub&quot;.

MORE INFORMATION
For more information about subroutines, see page 602 in the &quot;Microsoft Excel User's Guide&quot; version 3.0 manual. If you are using Excel 2.20, see pages 113-114 in the &quot;Microsoft Excel Functions and Macros&quot; version 2.2 manual.
 * }