I wrote a simple macro that opens a file and moves thru the sheets (20) in the file.
I also wrote 3 other macros. Each stored in a different module within the same file. In total the file has 4 macros/modules. The first one opens the target file and the other 3 perform different functions.
I want to only have to run the first macro and have the other 3 ran as needed. This is what I envision:
Sub Macro1()
ChDir "C:\04 Apr 11"
Workbooks.Open FileName:= _
"W:\04 Apr 11\Apr 2011 Calculation.xls" _
, UpdateLinks:=0
Sheets("Alternate Site").Select
Run Macro2()
Sheets("Principal Site").Select
Run Macro2()
Run Macro4()
Sheets("Home Site").Select
Run Macro2()
Run Macro3()
End Sub
When i run the code above I get this compile error: 'Expected variable or procedure, not module'. . The error happens right at the first Run Macro2(). To fix this I changed to "Run Macro2" then I recieved error '1004' 'Cannot run the macro 'Macro2'. The macro may not be available in this workbook or all macros may be disable.
How do I fix this?
Thank you
Bookmarks