Call a macro from another sheet


Posted by Edd on March 23, 2001 3:00 AM

I have produced a system for collecting data from various sales engineers. The system consists of 3 types of workbook. The sales data input sheet. This book has an ONOPEN procedure that checks the 2nd workbook. This workbook is the admin sheet and checks to see if the sales sheet is up to the current version and if not makes the necessary updates. This works ok. The third workbook is a consolidation sheet. This workbook has a macro which pulls in the data and consolidates it. This also works fine. What i am after doing is on opening each sales sheet to take the data. As it opens i want it to check each sheet in turn using the onopen macro. This works but after running the onopen macro it will not revert back to the original procedure and carry on where it left off. What can I do??



Posted by Amroo on March 26, 2001 5:11 AM

Bonjour,
I have two codes :
1- execution of a macro from an another open workbook.

Sub Essai()
Run("Workbook.xls!module2.macroName")
end sub

2- execution of a Macro
Sub CallingMacro()
Application.Run Macro:=Range(fileName.xls!_ MacroName")
End Sub
( you can change := by =)
Amroo