Consulting

Results 1 to 6 of 6

Thread: Selection.OnAction = "macro1"

  1. #1

    Selection.OnAction = "macro1"

    Hi,

    Selection.OnAction = "macro1"

    I know that the above code can run macro1 once we click the shape.

    Is it possible to run more than one macro?

    Thanks

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Yeah, in Macro1 call the other macro at the appropriate point.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    [VBA]
    Sub Macro1
    Macro2
    Macro3
    Macro4
    End Sub
    [/VBA]

    Paul

  4. #4
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,058
    Location
    Hmmmm... Shouldn't that be
    [VBA]
    Sub Macro 1()
    Call Macro 2
    Call Macro 3
    Call Macro 4
    [/VBA]
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  5. #5
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    I hadn't intended that the '2' and '3' and '4' be passed parameters

    Since the OP used 'Macro1', I just continued with parameter-less subs.

    [VBA]
    Option Explicit
    Sub macro1()
    Macro2
    Macro3
    Macro4
    End Sub
    Sub Macro2()
    MsgBox "Hello from Macro2"
    End Sub
    Sub Macro3()
    MsgBox "Hello from Macro3"
    End Sub
    Sub Macro4()
    MsgBox "Hello from Macro4"
    End Sub
    [/VBA]


    BTW, the 'space' in

    [VBA]
    Sub Macro 1()
    [/VBA]

    must have been a typo or a tags format problem, since you can't define a Sub name with a space in it


    Paul

  6. #6
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,058
    Location
    Yes it was, thanks Paul
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

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