how do I create a macro that will activate other macros?

  • Thread starter Thread starter sbrigham
  • Start date Start date
S

sbrigham

I am trying to create a Macro that will click on controls that have macros
assigned, this isn't working so I want to know if there is a way to nest the
sub's into this macro.
 
If you will put your macro's as functions or subs into a module (right click
your project and insert module) then you can call them from anywhere. example
Function CountStuff()
code
End Function
then under your click event,and anywhere else, just call CountStuff() and it
will run that code.
 
The standard way to do this is not to click on the other controls but rather
to run the code associated with those controls. So something like this...

sub LotsOfStuff()
Call DoThis
Call DoThat
end sub

sub DoThis()
msgbox "do this"
end sub

sub DoThat
msgbox "do that"
end sub
 
Thank you! I was missing the call part.

Jim Thomlinson said:
The standard way to do this is not to click on the other controls but rather
to run the code associated with those controls. So something like this...

sub LotsOfStuff()
Call DoThis
Call DoThat
end sub

sub DoThis()
msgbox "do this"
end sub

sub DoThat
msgbox "do that"
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

Back
Top