ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   re : Possible to run private sub macros by writing another private (https://www.excelbanter.com/excel-programming/338389-re-possible-run-private-sub-macros-writing-another-private.html)

ddiicc

re : Possible to run private sub macros by writing another private
 
Hi all,

I have 7 private subs ... all linked to indiviudal command button.
7 Private sub listed below :-

1) LGC01
2) LGC02
3) LGC03
4) LGC04
5) LGC05
6) LGC06
7) LGC07

I want to write another PRIVATE sub to run all the private subs LGC01, 02,
03, 04 ,05 ,06 and 07 together ... can it be done???

sebastienm

re : Possible to run private sub macros by writing another private
 

Hi,
Assuming these subs have no parameters:
Sub RunAll()
LGC01
LGC02
LGC03
LGC04
LGC05
LGC06
LGC07
End Sub
--
Regards,
S矇bastien
<http://www.ondemandanalysis.com


"ddiicc" wrote:

Hi all,

I have 7 private subs ... all linked to indiviudal command button.
7 Private sub listed below :-

1) LGC01
2) LGC02
3) LGC03
4) LGC04
5) LGC05
6) LGC06
7) LGC07

I want to write another PRIVATE sub to run all the private subs LGC01, 02,
03, 04 ,05 ,06 and 07 together ... can it be done???


ddiicc

re : Possible to run private sub macros by writing another pri
 
Hi Sebastienm,
Let say I have 3 different private sub stated below

1)
Private Sub AllModelsLGC011stAndFinalPass_Click()
End Sub

2)
Private Sub AllModelsLGC021stAndFinalPass_Click()
End Sub

3)
Private Sub AllModelsLGC031stAndFinalPass_Click()
End sub

All these private sub contains VB codes in it.
What I would like to do now is to write another private sub to run all these
private sub... so how should go abt writing it?


"sebastienm" wrote:


Hi,
Assuming these subs have no parameters:
Sub RunAll()
LGC01
LGC02
LGC03
LGC04
LGC05
LGC06
LGC07
End Sub
--
Regards,
S矇bastien
<http://www.ondemandanalysis.com


"ddiicc" wrote:

Hi all,

I have 7 private subs ... all linked to indiviudal command button.
7 Private sub listed below :-

1) LGC01
2) LGC02
3) LGC03
4) LGC04
5) LGC05
6) LGC06
7) LGC07

I want to write another PRIVATE sub to run all the private subs LGC01, 02,
03, 04 ,05 ,06 and 07 together ... can it be done???


sebastienm

re : Possible to run private sub macros by writing another pri
 
You would just do:
Sub RunAll()
AllModelsLGC011stAndFinalPass_Click
AllModelsLGC021stAndFinalPass_Click
AllModelsLGC031stAndFinalPass_Click
End Sub
--

Running RunAll would execute each of these subs one after each other.
Regards,
S矇bastien
<http://www.ondemandanalysis.com


"ddiicc" wrote:

Hi Sebastienm,
Let say I have 3 different private sub stated below

1)
Private Sub AllModelsLGC011stAndFinalPass_Click()
End Sub

2)
Private Sub AllModelsLGC021stAndFinalPass_Click()
End Sub

3)
Private Sub AllModelsLGC031stAndFinalPass_Click()
End sub

All these private sub contains VB codes in it.
What I would like to do now is to write another private sub to run all these
private sub... so how should go abt writing it?


"sebastienm" wrote:


Hi,
Assuming these subs have no parameters:
Sub RunAll()
LGC01
LGC02
LGC03
LGC04
LGC05
LGC06
LGC07
End Sub
--
Regards,
S矇bastien
<http://www.ondemandanalysis.com


"ddiicc" wrote:

Hi all,

I have 7 private subs ... all linked to indiviudal command button.
7 Private sub listed below :-

1) LGC01
2) LGC02
3) LGC03
4) LGC04
5) LGC05
6) LGC06
7) LGC07

I want to write another PRIVATE sub to run all the private subs LGC01, 02,
03, 04 ,05 ,06 and 07 together ... can it be done???


T-容x[_25_]

re : Possible to run private sub macros by writing another private
 

Yes you can, if all 7 and the new private subs are located in the same
module...

ddiicc Wrote:
Hi all,

I have 7 private subs ... all linked to indiviudal command button.
7 Private sub listed below :-

1) LGC01
2) LGC02
3) LGC03
4) LGC04
5) LGC05
6) LGC06
7) LGC07

I want to write another PRIVATE sub to run all the private subs LGC01,
02,
03, 04 ,05 ,06 and 07 together ... can it be done???



--
T-容x
------------------------------------------------------------------------
T-容x's Profile: http://www.excelforum.com/member.php...o&userid=26572
View this thread: http://www.excelforum.com/showthread...hreadid=399339


T-容x[_26_]

re : Possible to run private sub macros by writing another private
 

You can write something like:

Private Sub RunAllThree()
AllModelsLGC011stAndFinalPass_Click
AllModelsLGC021stAndFinalPass_Click
AllModelsLGC031stAndFinalPass_Click
End Sub

That is, if you're only interested in executing the codes in the
subs... :)

ddiicc Wrote:
Hi Sebastienm,
Let say I have 3 different private sub stated below

1)
Private Sub AllModelsLGC011stAndFinalPass_Click()
End Sub

2)
Private Sub AllModelsLGC021stAndFinalPass_Click()
End Sub

3)
Private Sub AllModelsLGC031stAndFinalPass_Click()
End sub

All these private sub contains VB codes in it.
What I would like to do now is to write another private sub to run al
these
private sub... so how should go abt writing it?


"sebastienm" wrote:


Hi,
Assuming these subs have no parameters:
Sub RunAll()
LGC01
LGC02
LGC03
LGC04
LGC05
LGC06
LGC07
End Sub
--
Regards,
S矇bastien
<http://www.ondemandanalysis.com


"ddiicc" wrote:

Hi all,

I have 7 private subs ... all linked to indiviudal command button.
7 Private sub listed below :-

1) LGC01
2) LGC02
3) LGC03
4) LGC04
5) LGC05
6) LGC06
7) LGC07

I want to write another PRIVATE sub to run all the private sub

LGC01, 02,
03, 04 ,05 ,06 and 07 together ... can it be done??


--
T-容
-----------------------------------------------------------------------
T-容x's Profile: http://www.excelforum.com/member.php...fo&userid=2657
View this thread: http://www.excelforum.com/showthread.php?threadid=39933



All times are GMT +1. The time now is 05:27 AM.

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