Hi,
I want to reduce the amount of editing I have to do on a lot of macros. The top 10 lines of each of my modules are unique to that module but the other 100+ lines beneath these 10 are the same in each module.
Is there a way to call a Macro2 that can contain these 100+ lines from Macro1, have it run the sub and then pass back to the macro that called it? Once it's passed back to Macro1 Macro1 would finish processing and call the next unique macro that it needed to run the 10 lines of unique code and then calls Macro2 again.
I was thinking like this:
I'm really sorry if that's not clear but please feel free to ask questions.
Thank you for your time and again apologies for what could be such a poor explanation.
Mark.
EDIT: All modules are in the same project.
I want to reduce the amount of editing I have to do on a lot of macros. The top 10 lines of each of my modules are unique to that module but the other 100+ lines beneath these 10 are the same in each module.
Is there a way to call a Macro2 that can contain these 100+ lines from Macro1, have it run the sub and then pass back to the macro that called it? Once it's passed back to Macro1 Macro1 would finish processing and call the next unique macro that it needed to run the 10 lines of unique code and then calls Macro2 again.
I was thinking like this:
Code:
Sub Macro1()
10 unique lines of code
Call Macro2
>>>> Waits for Macro2 <<<<<
Sub Macro2()
100+ lines of code
Call Macro1
>>>>> Hands back to Macro1 <<<<<
Sub Macro1()
Continues from after it called Macro2
Call Next_Unique_Macro
I'm really sorry if that's not clear but please feel free to ask questions.
Thank you for your time and again apologies for what could be such a poor explanation.
Mark.
EDIT: All modules are in the same project.