ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Path (https://www.excelbanter.com/excel-programming/349466-macro-path.html)

Brian Matlack[_41_]

Macro Path
 

Hi!
I started out in Lotus 123. In that application if I told a macro t
"Branch" to another macro it would run that macro and then end. If
told it to "Run" a macro it would run that macro and then return to th
original macro and continue on.
How does it work in Excel VBA? I currently use an IF and then EN
statement to "Branch" to another macro but is there a better way?
Any help or examples would be greatly appreciated

--
Brian Matlac
-----------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...nfo&userid=350
View this thread: http://www.excelforum.com/showthread.php?threadid=49787


galimi

Macro Path
 
Brian,

In VBA you are calling other functions and/or subroutines. After a
function/subroutine that you have called has completed, control will return
from the function/subroutine from which you placed the call.
--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"Brian Matlack" wrote:


Hi!
I started out in Lotus 123. In that application if I told a macro to
"Branch" to another macro it would run that macro and then end. If I
told it to "Run" a macro it would run that macro and then return to the
original macro and continue on.
How does it work in Excel VBA? I currently use an IF and then END
statement to "Branch" to another macro but is there a better way?
Any help or examples would be greatly appreciated.


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=497878



Bob Phillips[_6_]

Macro Path
 
Just call the other macro from within your code

Sub CallerMacro()
Msgbox "hello"
' more code

CalledMacro

' more code
End Sub

Sub CalledMacro()
...
End Sub

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Brian Matlack"
wrote in message
news:Brian.Matlack.2144cm_1136382002.1785@excelfor um-nospam.com...

Hi!
I started out in Lotus 123. In that application if I told a macro to
"Branch" to another macro it would run that macro and then end. If I
told it to "Run" a macro it would run that macro and then return to the
original macro and continue on.
How does it work in Excel VBA? I currently use an IF and then END
statement to "Branch" to another macro but is there a better way?
Any help or examples would be greatly appreciated.


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile:

http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=497878





All times are GMT +1. The time now is 12:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com