ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro for running other macro (https://www.excelbanter.com/excel-programming/298380-macro-running-other-macro.html)

pippo100[_7_]

macro for running other macro
 
How cam i write a macro for running 3 others macro?
Thank you
By

--
Message posted from http://www.ExcelForum.com


Chris

macro for running other macro
 
As long as they're all in the same Module just put in the name of the other macros in that one, VBA will do the rest
Else if there in the same project you have to qualify the whole name

Private Sub RunMacros(
Macro
Macro
Macro
End Su

----- pippo100 wrote: ----

How cam i write a macro for running 3 others macro
Thank yo
By


--
Message posted from http://www.ExcelForum.com



SunTzuComm

macro for running other macro
 
If the macros you want to run are in the same workbook, just call them:

Sub Main_Macro()
Call Some_Other_Macro1
Call Some_Other_Macro2
End Sub

Sub Some_Other_Macro1()
. . .
End Sub

Sub Some_Other_Macro2()
. . .
End Sub

If a macro is in a different workbook, use the Application.Run method:

Application.Run _
"Other_Workbook.xls!Other_Macro"

Regards,
Wes


All times are GMT +1. The time now is 12:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com