VB code to run multiple macro

  • Thread starter Thread starter Cam
  • Start date Start date
C

Cam

Hello,

I have several macro that need to be ran once a button is click.
What VB code I put to tell it to run several macro?
 
You run the first macro then call the second from that i.e.

Sub Sonic()
'do something
mynextmacro
end sub


Sub mynextmacro()
'do something else
mythirdmacro
end sub

sub mythirdmacro()
etc

Mike
 
To be more specific:

'Coce behind the command button

Private Sub CommandButton1_Click()
MainMacro
End Sub

'Code in standard code Module1

Sub MainMacro
Macro1name
Macro2name
Macro3name
...
Macronname
End Sub
 
Typo!
Shoud be Sub MainMacro()

JLGWhiz said:
To be more specific:

'Coce behind the command button

Private Sub CommandButton1_Click()
MainMacro
End Sub

'Code in standard code Module1

Sub MainMacro
Macro1name
Macro2name
Macro3name
...
Macronname
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top