ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   stringing macros together (https://www.excelbanter.com/excel-programming/328090-stringing-macros-together.html)

iamn94

stringing macros together
 
I would like to have a second macro kick off after the first macro has
completed its tasks. How can I go about doing this? I could do a cut and
paste of the language for the second macro into the body of the first but am
assuming that there is a better way to do this.

Thoughts?

Thanks
--
sd

Vasant Nanavati

stringing macros together
 
As long as the macros are in the same module, you can just put the name of
the second macro on the last line of the first macro. That will call the
second macro.

Sub Macro1()
...
...
...
Macro2
End Sub

--

Vasant

"iamn94" wrote in message
...
I would like to have a second macro kick off after the first macro has
completed its tasks. How can I go about doing this? I could do a cut and
paste of the language for the second macro into the body of the first but

am
assuming that there is a better way to do this.

Thoughts?

Thanks
--
sd




Tom Ogilvy

stringing macros together
 
Sub Macro1()
' existing code

Macro2 ' starts macro2
End Sub

--
Regards,
Tom Ogilvy

"iamn94" wrote in message
...
I would like to have a second macro kick off after the first macro has
completed its tasks. How can I go about doing this? I could do a cut and
paste of the language for the second macro into the body of the first but

am
assuming that there is a better way to do this.

Thoughts?

Thanks
--
sd





All times are GMT +1. The time now is 08:13 PM.

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