How can you execute a macro within another macro.
Example: Run macro a in macro b. Cutting and pasting does not seem to work.
How can you execute a macro within another macro.
Example: Run macro a in macro b. Cutting and pasting does not seem to work.
Something like this..
Sub Macro1()
msgbox "macro1"
call Macro2
exit sub
Sub Macro2()
msgbox "macro2"
exit sub
--
HTH...
Jim Thomlinson
"norrislaketn" wrote:
> How can you execute a macro within another macro.
>
> Example: Run macro a in macro b. Cutting and pasting does not seem to work.
>
>
Sub hello()
Call boxit
End Sub
Sub boxit()
MsgBox ("in boxit")
End Sub
--
Gary's Student
"norrislaketn" wrote:
> How can you execute a macro within another macro.
>
> Example: Run macro a in macro b. Cutting and pasting does not seem to work.
>
>
Sub Macro1()
Msgbox "Macro1"
' some code
Macro2
End Sub
Sub Macro2()
Msgbox "Macro2"
' some code
Macro3
Macro4
End Sub
Sub Macro3()
Msgbox "Macro3"
' some code
End Sub
Sub Macro4()
Msgbox "Macro4"
' some code
End Sub
Regards
Trevor
"norrislaketn" <[email protected]> wrote in message
news:[email protected]...
> How can you execute a macro within another macro.
>
> Example: Run macro a in macro b. Cutting and pasting does not seem to
> work.
>
>
Thanks for the info. Your solution will run if I step into it. If I run ir
directly from the macro shortcut key it does not run. It acts as if it is
executing the next command before the call is complete. Any other thoughts?
"Gary''s Student" wrote:
> Sub hello()
> Call boxit
> End Sub
>
> Sub boxit()
> MsgBox ("in boxit")
> End Sub
> --
> Gary's Student
>
>
> "norrislaketn" wrote:
>
> > How can you execute a macro within another macro.
> >
> > Example: Run macro a in macro b. Cutting and pasting does not seem to work.
> >
> >
Thanks for the info. Your solution will run if I step into it. If I run ir
directly from the macro shortcut key it does not run. It acts as if it is
executing the next command before the call is complete. Any other thoughts?
"Trevor Shuttleworth" wrote:
> Sub Macro1()
> Msgbox "Macro1"
> ' some code
> Macro2
> End Sub
>
> Sub Macro2()
> Msgbox "Macro2"
> ' some code
> Macro3
> Macro4
> End Sub
>
> Sub Macro3()
> Msgbox "Macro3"
> ' some code
> End Sub
>
> Sub Macro4()
> Msgbox "Macro4"
> ' some code
> End Sub
>
> Regards
>
> Trevor
>
>
> "norrislaketn" <[email protected]> wrote in message
> news:[email protected]...
> > How can you execute a macro within another macro.
> >
> > Example: Run macro a in macro b. Cutting and pasting does not seem to
> > work.
> >
> >
>
>
>
Thanks for the info. Your solution will run if I step into it. If I run ir
directly from the macro shortcut key it does not run. It acts as if it is
executing the next command before the call is complete. Any other thoughts?
"Jim Thomlinson" wrote:
> Something like this..
>
> Sub Macro1()
> msgbox "macro1"
> call Macro2
> exit sub
>
> Sub Macro2()
> msgbox "macro2"
> exit sub
>
>
> --
> HTH...
>
> Jim Thomlinson
>
>
> "norrislaketn" wrote:
>
> > How can you execute a macro within another macro.
> >
> > Example: Run macro a in macro b. Cutting and pasting does not seem to work.
> >
> >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks