Macro's

F

Frank Kabel

Hi
have a look at the Call method in the Excel vBA help or just simply
enter the macro name of your sub macro in your main macro:

sub main_macro()
'do something
other_macro
'do something more
end sub

sub other_macro()
'do now something completely different
end sub
 
B

Bob Umlas, Excel MVP

If you mean something like this, then yes, else please explain further
Sub StartHere(
RunOtherMacr
End Su

Sub RunOtherMacro(
msgbox "Got Here
End Su

----- ERH wrote: ----

It is possible to run a macro with in a macro in Excel
2000
 
G

Guest

Thanks

Only want other macro if certain condition is met in an IF
statement, if condition not met, would want macro to stop
there.
 
B

Bob Phillips

Are you sure you are up to this?

Sub StartHere()
If Range("C1").Value =1 Then
RunOtherMacro
End If
End Sub

Sub RunOtherMacro()
msgbox "Got Here"
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
F

Frank Kabel

Hi
still not that much information but try something like

sub main_macro()
'do something
If activesheet.range("A1").value = "Go" then
other_macro
end if
'do something more
end sub

sub other_macro()
msgbox "cell A1 contains 'Go'"
'do now something completely different
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