Writing a multi-function macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Bob answered me this morning, but I haven't heard back, so let's try this again. I have a successful macro (reformatting), but I want to add another sub group portion. I don't know how to program it when the macro is recording, so I have to cut & paste. Unfortunatly, when I run the macro, it hits the first End Sub Group & stops, as you would expect. How can I nest a separate command into an existing macro? E-mail me if you have the knowledge & time: LenZGRMich(remove this)@netscape.ne
Thanks
 
Len, try something like this
Sub macro1()
MsgBox "This is macro 1"
'put the rest of your code here, before the end sub
'or if you want to call another macro do something like this
macro2
End Sub
Sub macro2()
MsgBox "This is macro 2"
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
Len said:
Bob answered me this morning, but I haven't heard back, so let's try this
again. I have a successful macro (reformatting), but I want to add another
sub group portion. I don't know how to program it when the macro is
recording, so I have to cut & paste. Unfortunatly, when I run the macro, it
hits the first End Sub Group & stops, as you would expect. How can I nest a
separate command into an existing macro? E-mail me if you have the
knowledge & time: LenZGRMich(remove this)@netscape.net
 
Thanks a million, Paul. I just found this board yesterday in my frantic search for a way to write this macro. Like so many brilliant solutions, yours is almost embarassingly simplistic. I'm very impressed. I've been waiting all day for a response, so I won't be able to play with it tonite. However, I'm sure it will help me immeasurably in my project tomorrow.
Len
 
Back
Top