?
Solved

Can I have two sub procedures in one Macro in excel?

Posted on 2006-11-08
1
Medium Priority
?
287 Views
Last Modified: 2008-03-06
And if so, how would I do it?

Thanks
0
Comment
Question by:sarasotamac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 35

Accepted Solution

by:
mvidas earned 1000 total points
ID: 17898646
sarasotamac,

Yes, well kinda (one macro can only have one sub/end sub), you call other subs from the first.  A quick example:

Sub sarasotamac1()
 MsgBox "This is in the sarasotamac1 Sub"
 sarasotamac2
 Call sarasotamac4 'note that using/not-using call does the same thing
End Sub

Sub sarasotamac2()
 MsgBox "This is in the sarasotamac2 Sub"
 sarasotamac3
End Sub

Sub sarasotamac3()
 MsgBox "This is in the sarasotamac3 Sub"
End Sub

Sub sarasotamac4()
 MsgBox "This is in the sarasotamac4 Sub"
End Sub

Matt
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
The viewer will learn how to create multiple layers to apply various filters and how to delete areas from each layer’s filter.
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question