Run multiple macros

P

puiuluipui

Hi, is there any way i can run multiple macros located in diferent modules?
I want to have a button assigned to a macro and when i click it, the
multiple macro to run the macro in module 1, then the macro in module 2, then
the macro in module 3....
Can this be done?
Thanks!
 
G

Gary''s Student

Have the button connected to something like:

Sub MAIN()
Call Mac1
Call Mac2
Call Mac3
.......
End Sub


As long as the Mac's are not Private, you should be O.K.
 
P

puiuluipui

Hi Gary,

"As long as the Mac's are not Private, you should be O.K."
I don't know so much to understand exactly what this refer to, but i receive
an error:
Compile error:
Sub or Function not defined.
I have 4 modules.
Module1
Module2
Module3
Main
Main module has your code.
What am i doing wrong?
Thanks!
 
G

Gord Dibben

Excel knows where the macros are so you don't have to designate modules.

Sub Call_All()
macro1
macro2
macro3
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

Top