Macro's

  • Thread starter Thread starter ERH
  • Start date Start date
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
 
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
 
Thanks

Only want other macro if certain condition is met in an IF
statement, if condition not met, would want macro to stop
there.
 
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)
 
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
 
Thanks. Hope you are still around after this long delay.
Have tried your advice below. However, keep getting message
"Sub or Function not defined" for RunOtherMacro. Tried
renaming other macro to OtherMacro but no joy.

Any thoughts/help?
 
Back
Top