ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Subs (https://www.excelbanter.com/excel-programming/380287-subs.html)

Donna C

Subs
 
I had one rather large sub that worked great, I broke down into 8 seperate
subs to simplify code changes later on.I have a user form with a run button.
Originally it ran the one sub and worked great.Now with it split into many
how do I go from one sub straight into the next one until all are run??? This
is what the code looks like with just one of the subs listed.
Thanks in advance,
Donna C.

Private Sub RUN_Click()
ThisWorkbook.Worksheets.Add
Questions
Me.Hide
Unload Test
End Sub

Jim Cone

Subs
 
As long as all of the subs are in standard modules...

Private Sub RUN_Click()
ThisWorkbook.Worksheets.Add
Questions
Me.Hide
Unload Test
OtherSub2
OtherSub3

OtherSub4
OtherSub5

OtherSub6
OtherSub7

OtherSub8
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Donna C"
wrote in message
I had one rather large sub that worked great, I broke down into 8 seperate
subs to simplify code changes later on.I have a user form with a run button.
Originally it ran the one sub and worked great.Now with it split into many
how do I go from one sub straight into the next one until all are run??? This
is what the code looks like with just one of the subs listed.
Thanks in advance,
Donna C.

Private Sub RUN_Click()
ThisWorkbook.Worksheets.Add
Questions
Me.Hide
Unload Test
End Sub

Donna C

Subs
 
Well I tried your suggestion. It seems to be locking up with an error stating
"sub or function not defined" and highlites
Questions
???Any suggestions
Thanks Donna C.


"Jim Cone" wrote:

As long as all of the subs are in standard modules...

Private Sub RUN_Click()
ThisWorkbook.Worksheets.Add
Questions
Me.Hide
Unload Test
OtherSub2
OtherSub3

OtherSub4
OtherSub5

OtherSub6
OtherSub7

OtherSub8
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Donna C"
wrote in message
I had one rather large sub that worked great, I broke down into 8 seperate
subs to simplify code changes later on.I have a user form with a run button.
Originally it ran the one sub and worked great.Now with it split into many
how do I go from one sub straight into the next one until all are run??? This
is what the code looks like with just one of the subs listed.
Thanks in advance,
Donna C.

Private Sub RUN_Click()
ThisWorkbook.Worksheets.Add
Questions
Me.Hide
Unload Test
End Sub


Jim Cone

Subs
 
It is your code not mine...
What is "Questions"?
If it is a sub routine name, the sub should be in the same module as
the Run_Click sub or in a standard module. (as should all of the subs)
Jim Cone


"Donna C"
wrote in message
Well I tried your suggestion. It seems to be locking up with an error stating
"sub or function not defined" and highlites
Questions
???Any suggestions
Thanks Donna C.


"Jim Cone" wrote:

As long as all of the subs are in standard modules...

Private Sub RUN_Click()
ThisWorkbook.Worksheets.Add
Questions
Me.Hide
Unload Test
OtherSub2
OtherSub3

OtherSub4
OtherSub5

OtherSub6
OtherSub7

OtherSub8
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Donna C"
wrote in message
I had one rather large sub that worked great, I broke down into 8 seperate
subs to simplify code changes later on.I have a user form with a run button.
Originally it ran the one sub and worked great.Now with it split into many
how do I go from one sub straight into the next one until all are run??? This
is what the code looks like with just one of the subs listed.
Thanks in advance,
Donna C.

Private Sub RUN_Click()
ThisWorkbook.Worksheets.Add
Questions
Me.Hide
Unload Test
End Sub



All times are GMT +1. The time now is 03:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com