PDA

View Full Version : [SOLVED:] In a workbook in several sheets - each sheet several macro at once



k0st4din
02-21-2014, 01:06 PM
Hello to all
I would like to ask you if there is a way to activate several macro one button in a sheet. And then in the next sheet to reactivate a few (chosen by me) macros, and so for all other sheets.
Here's what I used for the first macro:

Sub CallMacros()
Macros in Module1 and Module2 and Module3 'Macros are triggered by one button in Sheet1
End Sub

Would it be okay if I do the same macro(Sub CallMacros), but changed the names of other macros, or if duplicate names(Sub CallMacros) will be a problem?

Sub CallMacros()
Macros in Module4 and Module7 and Module33 'Macros are triggered by one button in Sheet2
End Sub

If there's something you do not understand, please ask me
Thank you in advance.

westconn1
02-21-2014, 02:11 PM
Sub CallMacros()
Macros In Module1 And Module2 And Module3 'Macros are triggered by one button in Sheet1
End Sub does this work? or what is your actual code?

k0st4din
02-21-2014, 10:56 PM
All 30 macro work.
My asking is: If different Module1, Module2, Module3 etc. I put this:
Sub CallMacros()
And in here I put the names of my desired macro for the first sheet
End Sub
For my second sheet again if I put this title
Sub CallMacros()
and here I put the names of the other macros that run in my second sheet (example)
End Sub
I ask this - >> Sub CallMacros () - I will give you an error when I press a button to trigger macros, ie have the same title a few macros, but there are different names?

westconn1
02-22-2014, 01:53 AM
you can have the same macro names in different object (worksheet) modules, but not in standard module, excel will give an error, duplicate procedue names