Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Calling macro from a different moldule

I created 4 different macros in 4 different modules. I like to create one
main macro which calls these 4 modules. I tried to enter the macro names one
after another in the new module and it's giving me an error. Do I need to
declare the other 4 macros to public?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calling macro from a different moldule


If the macros are in a normal module sheet you do not need to declare
them as public

try

Sub MainMacro ()
Call Macro1
Call Macro2
Call Macro3
Call Macro4
MyInfo = Function5Result
End Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=518093

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Calling macro from a different moldule

Thanks to your reply. I tied your suggestion but still get an error.
I created the macros in modules. Instead of calling them module1,
module2...I renamed the macros. In my main macro, I enter the follwing codes:

Sub main()
Call DelFre_Keystone
Call DelFre_Symmetry
Call DelFre_Folio
Call RecFre_Keystone
Call RecFre_Symmetry
Call RecFre_Foli
end sub()

I get an error "Compile Error" expected variables or procedures, not module


"mudraker" wrote:


If the macros are in a normal module sheet you do not need to declare
them as public

try

Sub MainMacro ()
Call Macro1
Call Macro2
Call Macro3
Call Macro4
MyInfo = Function5Result
End Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=518093


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Calling macro from a different moldule

Sorry, my mistake. I call the module name instead of the name of the sub
procedure.

"Vanna" wrote:

Thanks to your reply. I tied your suggestion but still get an error.
I created the macros in modules. Instead of calling them module1,
module2...I renamed the macros. In my main macro, I enter the follwing codes:

Sub main()
Call DelFre_Keystone
Call DelFre_Symmetry
Call DelFre_Folio
Call RecFre_Keystone
Call RecFre_Symmetry
Call RecFre_Foli
end sub()

I get an error "Compile Error" expected variables or procedures, not module


"mudraker" wrote:


If the macros are in a normal module sheet you do not need to declare
them as public

try

Sub MainMacro ()
Call Macro1
Call Macro2
Call Macro3
Call Macro4
MyInfo = Function5Result
End Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=518093


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling a macro jhahes[_25_] Excel Programming 6 August 4th 05 12:22 AM
Trouble calling macro James W.[_2_] Excel Programming 1 May 5th 05 07:07 PM
Calling a macro from a key RWN Excel Programming 0 February 8th 05 05:19 AM
Calling Outlook Macro sgreville Excel Programming 0 October 25th 04 12:03 PM
Calling macro in add-in. Clark B Excel Programming 1 July 24th 03 11:05 PM


All times are GMT +1. The time now is 11:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"