application run - macros within macros

G

Guest

Hi there,

I have a number of macros that I want to be activated in a series by
attaching them all to one 'button' on the work sheet they relate to.

That works fine to start with but because the workbook will be opened and
then saved with a different name by users, the "Application run ......xls
..Sheet13."macroname" approach means an error message about not finding the
macro. How do I code this so that the macros can be found whatever the user
names the book after opening it.

Thanks

Sybs
 
G

Guest

If all the macro (subroutines) are in one workbook, then just ue the call
mysub(parm1,parrm2,...). No workbook references are required.
 
G

Guest

Thanks Joel,

Sorry to be so thick, how do I phrase it?

As in this is what I presently have. Howe do I phrase it correctly?


'THIS IS THE MACRO THAT CALLS THE SUBS TO UPDATE THE RESULTS PAGE'


Sub UPDATERESULTSHEET()
ActiveSheet.Unprotect ("sybs")

Sheets("RESULTS").Select
Application.Run _
"'isa scoring programme 2007 VBA 1.xls'!Sheet9.postFootlockresultsmen"

Sheets("RESULTS").Select
Application.Run _
"'isa scoring programme 2007 VBA 1.xls'!Sheet9.postthrowresultsmen"

Sheets("RESULTS").Select
Application.Run _
"'isa scoring programme 2007 VBA
1.xls'!Sheet9.postSpeedclimbresultsmen"
 
G

Guest

Application.Run _
"'isa scoring programme 2007 VBA
1.xls'!Sheet9.postFootlockresultsmen"

worrkbooks("'isa scoring programme 2007 VBA 1.xls").activate
sheets("Sheet9").activate
call postFootlockresultsmen()
call postthrowresultsmen()
call postSpeedclimbresultsmen()


when I have multiple subroutine I would do this

sub main()

call sub1(bob,joe)
call sub2(carrol)

end sub

sub sub1(parm1,parm2)


end sub
sub sub2(parm1)


end sub
 
G

Guest

Thanks so much, sorted. Great

Regards,

Sybs

Joel said:
Application.Run _
"'isa scoring programme 2007 VBA
1.xls'!Sheet9.postFootlockresultsmen"

worrkbooks("'isa scoring programme 2007 VBA 1.xls").activate
sheets("Sheet9").activate
call postFootlockresultsmen()
call postthrowresultsmen()
call postSpeedclimbresultsmen()


when I have multiple subroutine I would do this

sub main()

call sub1(bob,joe)
call sub2(carrol)

end sub

sub sub1(parm1,parm2)


end sub
sub sub2(parm1)


end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top