Results 1 to 3 of 3

Thread: Executing Macros
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Jul 2005
    Location
    Avalon
    Posts
    83
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Executing Macros

    Simple question (I hope): What is the syntax in vbscript to excecute a macro?

  2. #2
    MrExcel MVP Richie(UK)'s Avatar
    Join Date
    May 2002
    Location
    UK
    Posts
    3,329
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Eddie,

    If you want to execute Sub2 from within Sub1 then use the Call statement, like this:
    Code:
    Sub Sub1()
        MsgBox "Part1"
        Call Sub2
        MsgBox "Part3"
    End Sub
    
    Sub Sub2()
        MsgBox "Part2"
    End Sub
    Highlight the word Call while in the VBE and press F1 to get the info from the Help files on this topic.

    HTH
    Richie

  3. #3
    Board Regular
    Join Date
    Jul 2005
    Location
    Avalon
    Posts
    83
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    worked like a top. I was able to embed and call macros from a number of different points in the code. If it wasnt hard to tell, i'm a rook at this so I really do appreciate the help.

    James

Some videos you may like

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
  •