Closed Thread
Results 1 to 4 of 4

Have 2 Macros run in a specific order...Can This Be Done

  1. #1
    Dtown Dawg
    Guest

    Have 2 Macros run in a specific order...Can This Be Done

    Right now I have a macro named Auto_open and as you know as soon as excel is
    opened it runs the macro. This macro copies 100 Excel spreadsheets from one
    location on the network to a different location. Works Fine.

    I then have another macro that takes all those 100 spreadsheets and combines
    them into 1 spreasheet. Works Fine.

    Is there a way that I can have the Auto_open macro run 1st just like it
    does, and then as soon as it finishes, have the other Macro to merge the
    spreadsheets run without the user having to acutally click on Run Macro?

    Thanks;
    The Dawg

  2. #2
    Chip Pearson
    Guest

    Re: Have 2 Macros run in a specific order...Can This Be Done

    Just call the second macro from Auto_Open:

    Sub Auto_Open()
    ' your code
    SecondMacro
    End Sub


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Dtown Dawg" <[email protected]> wrote in
    message
    news:[email protected]...
    > Right now I have a macro named Auto_open and as you know as
    > soon as excel is
    > opened it runs the macro. This macro copies 100 Excel
    > spreadsheets from one
    > location on the network to a different location. Works Fine.
    >
    > I then have another macro that takes all those 100 spreadsheets
    > and combines
    > them into 1 spreasheet. Works Fine.
    >
    > Is there a way that I can have the Auto_open macro run 1st just
    > like it
    > does, and then as soon as it finishes, have the other Macro to
    > merge the
    > spreadsheets run without the user having to acutally click on
    > Run Macro?
    >
    > Thanks;
    > The Dawg




  3. #3
    Dtown Dawg
    Guest

    Re: Have 2 Macros run in a specific order...Can This Be Done

    I keep getting a compile error:
    Only comments may appear after End Sub, End Function, or End Property

    "Chip Pearson" wrote:

    > Just call the second macro from Auto_Open:
    >
    > Sub Auto_Open()
    > ' your code
    > SecondMacro
    > End Sub
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    > "Dtown Dawg" <[email protected]> wrote in
    > message
    > news:[email protected]...
    > > Right now I have a macro named Auto_open and as you know as
    > > soon as excel is
    > > opened it runs the macro. This macro copies 100 Excel
    > > spreadsheets from one
    > > location on the network to a different location. Works Fine.
    > >
    > > I then have another macro that takes all those 100 spreadsheets
    > > and combines
    > > them into 1 spreasheet. Works Fine.
    > >
    > > Is there a way that I can have the Auto_open macro run 1st just
    > > like it
    > > does, and then as soon as it finishes, have the other Macro to
    > > merge the
    > > spreadsheets run without the user having to acutally click on
    > > Run Macro?
    > >
    > > Thanks;
    > > The Dawg

    >
    >
    >


  4. #4
    Chip Pearson
    Guest

    Re: Have 2 Macros run in a specific order...Can This Be Done

    This message indicates that you are placing the call to
    SecondMacro after the End Sub statement. Don't do that. Put it
    before the End Sub line.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Dtown Dawg" <[email protected]> wrote in
    message
    news:[email protected]...
    >I keep getting a compile error:
    > Only comments may appear after End Sub, End Function, or End
    > Property
    >
    > "Chip Pearson" wrote:
    >
    >> Just call the second macro from Auto_Open:
    >>
    >> Sub Auto_Open()
    >> ' your code
    >> SecondMacro
    >> End Sub
    >>
    >>
    >> --
    >> Cordially,
    >> Chip Pearson
    >> Microsoft MVP - Excel
    >> Pearson Software Consulting, LLC
    >> www.cpearson.com
    >>
    >>
    >> "Dtown Dawg" <[email protected]> wrote in
    >> message
    >> news:[email protected]...
    >> > Right now I have a macro named Auto_open and as you know as
    >> > soon as excel is
    >> > opened it runs the macro. This macro copies 100 Excel
    >> > spreadsheets from one
    >> > location on the network to a different location. Works Fine.
    >> >
    >> > I then have another macro that takes all those 100
    >> > spreadsheets
    >> > and combines
    >> > them into 1 spreasheet. Works Fine.
    >> >
    >> > Is there a way that I can have the Auto_open macro run 1st
    >> > just
    >> > like it
    >> > does, and then as soon as it finishes, have the other Macro
    >> > to
    >> > merge the
    >> > spreadsheets run without the user having to acutally click
    >> > on
    >> > Run Macro?
    >> >
    >> > Thanks;
    >> > The Dawg

    >>
    >>
    >>




Closed 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