ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   include macros in another macro (https://www.excelbanter.com/excel-programming/355899-include-macros-another-macro.html)

jnewl

include macros in another macro
 
i have a macro where i create literals based on a date scheme.

i want to use that in several other macros and not key the code each time
because if i have to make a change, i have to go to 20 programs. these
programs generate month end reports that have a date literal as part of the
heading.

how do i include the 'date macro' in the others and then continue with the
processing of the macro that now has the datemacro embedded.

i was looking for an include statement but do not find.

thanks

Trevor Shuttleworth

include macros in another macro
 
Sub Macro1()
Msgbox "Macro1"
' some code
Macro2
End Sub

Sub Macro2()
Msgbox "Macro2"
' some code
Macro3
Macro4
End Sub

Sub Macro3()
Msgbox "Macro3"
' some code
End Sub

Sub Macro4()
Msgbox "Macro4"
' some code
End Sub

Regards

Trevor


"jnewl" wrote in message
...
i have a macro where i create literals based on a date scheme.

i want to use that in several other macros and not key the code each time
because if i have to make a change, i have to go to 20 programs. these
programs generate month end reports that have a date literal as part of
the
heading.

how do i include the 'date macro' in the others and then continue with
the
processing of the macro that now has the datemacro embedded.

i was looking for an include statement but do not find.

thanks




kwiklearner[_7_]

include macros in another macro
 

declare your date macro as
public sub datemacro()
and then call this macro within your code of the other macro.

jnewl Wrote:
i have a macro where i create literals based on a date scheme.

i want to use that in several other macros and not key the code each
time
because if i have to make a change, i have to go to 20 programs. these
programs generate month end reports that have a date literal as part of
the
heading.

how do i include the 'date macro' in the others and then continue with
the
processing of the macro that now has the datemacro embedded.

i was looking for an include statement but do not find.

thanks



--
kwiklearner
------------------------------------------------------------------------
kwiklearner's Profile: http://www.excelforum.com/member.php...o&userid=31909
View this thread: http://www.excelforum.com/showthread...hreadid=521904



All times are GMT +1. The time now is 12:32 AM.

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