Running Multiple Modules With 1 Command

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Would anybody have any idea how to use one procedure to run multiple number of modules at one time. I have ~13 different modules and need to call the modules in various combinations. Many thanks!
 
Perhaps something like:-

Sub Master()

If x > 10 Then
Call Sub1
Call Sub5
Call Sub3
Call Sub2
Call Sub4

Else
Call Sub2
Call Sub1
Call Sub3
Call Sub4
Call Sub5
End If

End Sub

Don't really need the Calls but makes it obvious what you are doing.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



Gary said:
Would anybody have any idea how to use one procedure to run multiple number of
modules at one time. I have ~13 different modules and need to call the modules
in various combinations. Many thanks!
 
Gary,

Modules do not run. Procedures and Functions within Modules run.

If a procedure within a module has the same name as a procedure in another
module, then you can qualify procedures with the module name. eg.

Sub Test()
Module1.RunMeForEffect()
Module2.RunMeForEffect()
End Sub

Within Module 1:
Sub RunMeForEffect()
MsgBox "Message Box 1"
End Sub

Within Module 2:
Sub RunMeForEffect()
MsgBox "Message Box 2"
End Sub



--
Rob van Gelder - http://www.vangelder.co.nz/excel


Gary said:
Would anybody have any idea how to use one procedure to run multiple
number of modules at one time. I have ~13 different modules and need to
call the modules in various combinations. Many thanks!
 
Back
Top