Excel Macro subroutines

%3CLINGO-SUB%20id%3D%22lingo-sub-2265514%22%20slang%3D%22en-US%22%3EExcel%20Macro%20subroutines%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2265514%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20macro%20that%20works%20with%20the%20following%20basic%20structure%3A%3C%2FP%3E%3CP%3E__________________________%3C%2FP%3E%3CP%3ESub%20Macro1()%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECall%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BjrMacro1%3C%2FP%3E%3CP%3ECall%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BjrMacro2%3C%2FP%3E%3CP%3ECall%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BjrMacro3%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEnd%20Sub%3C%2FP%3E%3CP%3E_______________________%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20some%20of%20the%20new%20macros%20that%20I%20created%20in%20the%20same%20workbook%2C%20for%20reasons%20that%20are%20entirely%20unclear%20to%20me%2C%20Excel%20has%20added%20the%20filename%20and%20module%20name%20in%20front%20of%20the%20Macro%20name.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I%20need%20something%20that%20looks%20like%3C%2FP%3E%3CP%3E_________________________%3C%2FP%3E%3CP%3ESub%20Macro2()%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECall%20%5Bfilename%5D!%5Bmodule%20name%5D.jrMacroA%3C%2FP%3E%3CP%3ECall%20%5Bfilename%5D!%5Bmodule%20name%5D.jrMacroB%3C%2FP%3E%3CP%3ECall%20%5Bfilename%5D!%5Bmodule%20name%5D.jrMacroC%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEnd%20Sub%3C%2FP%3E%3CP%3E_____________________________________%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20is%20the%20appropriate%20coding%20to%20achieve%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlternatively%20-%20and%20preferably%20-%20how%20do%20I%20remove%20the%20filename%20and%20module%20names%20from%20the%20leading%20naming%20convention%20for%20the%20macros%20themselves%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2265514%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2265642%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Macro%20subroutines%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2265642%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1022482%22%20target%3D%22_blank%22%3E%40mmrothsc%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMake%20sure%20that%20you%20don't%20have%20macros%20of%20the%20same%20name%20in%20multiple%20modules.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I have a macro that works with the following basic structure:

__________________________

Sub Macro1()

 

Call       jrMacro1

Call       jrMacro2

Call       jrMacro3

 

End Sub

_______________________

 

For some of the new macros that I created in the same workbook, for reasons that are entirely unclear to me, Excel has added the filename and module name in front of the Macro name.

 

So I need something that looks like

_________________________

Sub Macro2()

 

Call [filename]![module name].jrMacroA

Call [filename]![module name].jrMacroB

Call [filename]![module name].jrMacroC

 

End Sub

_____________________________________

 

 

What is the appropriate coding to achieve this?

 

Alternatively - and preferably - how do I remove the filename and module names from the leading naming convention for the macros themselves?

 

Thanks!

 

 

 

1 Reply

@mmrothsc 

Make sure that you don't have macros of the same name in multiple modules.