ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   execute a macro from another macro (https://www.excelbanter.com/excel-programming/285566-execute-macro-another-macro.html)

joao

execute a macro from another macro
 
hi,

how do i execute a macro fron another macro? They are in the same
workbook, but in different worksheets!

Thanks


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


Tom Ogilvy

execute a macro from another macro
 
Sub MyMacro()
Sheet1.OtherMacro
End Sub

--
Regards,

"joao" wrote in message
...
hi,

how do i execute a macro fron another macro? They are in the same
workbook, but in different worksheets!

Thanks


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




Jim Rech

execute a macro from another macro
 
Macros on different modules of the same workbook are called exactly as if
they were in the same module - by their names:

In Module1:

Sub CallMod2Sub()
Mod2Sub
End Sub

In Module2:

Sub Mod2Sub()
MsgBox "Hello from Module2"
End Sub

--
Jim Rech
Excel MVP



KM[_2_]

execute a macro from another macro
 
Just put the name of the macro

Call macroname

regards
Km
-----Original Message-----
hi,

how do i execute a macro fron another macro? They are in

the same
workbook, but in different worksheets!

Thanks


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

.



All times are GMT +1. The time now is 09:03 AM.

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