Calling one macro winthin another macro
Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Calling one macro winthin another macro

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    How do I call a function in one macro from a function in another macro.
    Ive tried to use the run method unsuccesfully but surely there must be another way.

    Regards

  2. #2
    New Member
    Join Date
    Mar 2002
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    FunctionName(var1, var2)

    In some circumstances, you might need to type "Call " at the beginning. If it is really a function, you should be able to call it in the middle of an expression, e.g.
    Var3 = FunctionName(var1, var2) * var4

    Make sure the function is public if it is not in the same module.

  3. #3
    MrExcel MVP Russell Hauf's Avatar
    Join Date
    Feb 2002
    Location
    Portland, OR Area - USA
    Posts
    1,605
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    On 2002-03-12 13:01, tk19 wrote:
    FunctionName(var1, var2)

    In some circumstances, you might need to type "Call " at the beginning. If it is really a function, you should be able to call it in the middle of an expression, e.g.
    Var3 = FunctionName(var1, var2) * var4

    Make sure the function is public if it is not in the same module.
    Actually, you do not have to put "Call" in front of the function/procedure that does not return a value (explicitly, at least - it could return a value in a varible passed to it).

    One way:

    Call MyFuncThatDoesSomething(var1,var2)

    Second way:

    MyFuncThatDoesSomething var1, var2


    I think I like the Call way, in that it shows that another procedure is being called, but I use both ways in my programs.

    -rh

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com