+ Reply to Thread
Results 1 to 6 of 6

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

  1. #1
    ddiicc
    Guest

    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???

  2. #2
    sebastienm
    Guest

    RE: 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???


  3. #3
    ddiicc
    Guest

    RE: 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???


  4. #4
    Registered User
    Join Date
    08-24-2005
    Location
    Philippines
    Posts
    75
    Yes you can, if all 7 and the new private subs are located in the same module...

    Quote Originally Posted by ddiicc
    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???

  5. #5
    Registered User
    Join Date
    08-24-2005
    Location
    Philippines
    Posts
    75
    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 3 subs...

    Quote Originally Posted by ddiicc
    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???

  6. #6
    sebastienm
    Guest

    RE: 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???


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1