#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 210
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
File Path - Macro Max2073 Excel Worksheet Functions 1 December 6th 09 11:57 AM
How to remove path from macro reference seppo Excel Discussion (Misc queries) 2 February 22nd 06 07:08 AM
Macro for changing path in macro Nigel Excel Programming 2 August 16th 05 03:02 PM
File Path Macro JenO Excel Programming 2 September 27th 04 04:33 PM
How to lock the path to a macro JVS Excel Programming 3 December 11th 03 11:11 PM


All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"