+ Reply to Thread
Results 1 to 4 of 4

Run 2 Macros one after the other.

  1. #1
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Run 2 Macros one after the other.

    I have 2 Macros which are run one after the other. I would like to ask whether it is possible to adjust the following two codes so as to make them function more smoothly. This is how the macros function.



    The first macro, Macro 1, copies some cells from the active workbook (“Workbook 1) and then it opens another workbook, “Workbook 2”, and pastes the cells there. Once pasted the macro, saves “WorkBook 2” and closes it. Once closed a popup in the previous workbook, i.e. “Workbook 1” shows a pop up message box stating: "Data Successfully Archived". This macro can be found below:

    Please Login or Register  to view this content.
    The second macro. Opens “Workbook 2” (the same workbook 2 as above) performs an advanced filtering of the data, saves and closes “Workbook 2”. The Macro is found below:

    Please Login or Register  to view this content.
    What I had in mind was whether is it possible to smooth the process since currently: Workbook 2 is opened to run macro 1, saves and closes. Then it opens again, performs an advanced filtering, saves and closes.

    Would it be possible to join the two macros?

    If not, would it be possible to ensure that Workbook 2 is opened just once?

    Thanks a lot for your help and insightful suggestions

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,937

    Re: Run 2 Macros one after the other.

    Sure - try it like this. (It wasn't clear which sheet you want to filter - I thought it was Sheet2, but maybe not, so change it where indicated)

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Run 2 Macros one after the other.

    FWIW:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: Run 2 Macros one after the other.

    Thanks a lot everyone! It worked wonders!! Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 06-09-2015, 09:30 PM
  2. Replies: 1
    Last Post: 10-02-2013, 09:05 PM
  3. Replies: 5
    Last Post: 07-26-2012, 09:38 PM
  4. Macros: Data cleaning macros not producing expected outputes.
    By bertlogdi1 in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 06-17-2011, 06:52 AM
  5. [SOLVED] choose default macros Not Enabled / Macros Enable Setting
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2006, 08:10 AM

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