+ Reply to Thread
Results 1 to 5 of 5

Run a macro witin a macro

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Run a macro witin a macro

    I've heard its possible to "call" a macro from within another but i can't get the code correct.

    The macro i need to run is called Sub Macro13() and is in module 20

    Thanks

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Run a macro witin a macro

    post your code and identify what isn't working.
    modytrane

  3. #3
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301

    Re: Run a macro witin a macro

    It should be as simple as

    Module20.Macro13
    If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Run a macro witin a macro

    Hi cmb80

    Try
    Call Macro13
    John
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Forum Contributor
    Join Date
    03-02-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Run a macro witin a macro

    I have one where I run a whole string of macros one after the other. The first part is of mine is to have a macro to tab to a particular tab, and then another macro for whatever needs to happen on that tab. the "call" part calls up the macro, which is listed right after. So, if I was updating my customer service schedule it would read

    
        Call Tab_to_Daily_Schedules
        Call Update_CSR_Daily_Schedule
        Call Tab_to_Printable_Schedules_CSR
        Call Update_CSR_Daily_Printable_Schedule
        Call tab_from_Daily_printable_to_Employee_Info_Page
    The full macro that this runs in looks like this:

    Sub Update_Customer_Service()
    '
    ' Update_Customer_Service Macro
    '
        Call Switch_Tab_Master
        Call Update_List_1
        Call Tab_from_CSRGold_to_Gate_List
        Call Update_List_1
        Call tab_from_gate_to_IRR_List
        Call Update_List_1
        Call Tab_from_IRR_to_Flex_List
        Call Update_List_1
        Call Tab_from_Flex_to_VSA_List
        Call Tab_From_VSA_to_VSA_Lead_List
        Call Tab_from_VSA_Lead_to_VSA_Buswash_List
        Call Tab_from_VSA_Buswash_to_Counter_1_List
        Call Update_List_1
        Call Tab_from_Counter_1_to_Counter_2_List
        Call Update_List_1
        Call Tab_from_Counter_2_to_Counter_3_List
        Call Update_List_1
        Call Tab_from_Counter_3_to_Counter_4_List
        Call Update_List_1
        Call Tab_from_Counter_4_to_CSRAdmin_List
        Call Update_List_1
        Call Tab_to_Yellow_Jacket_weekly_Schedule
        Call Update_List_1
        Call Tab_to_Greeter_weekly_Schedule
        Call Update_List_1
        Call Tab_to_DIspatcher_Weekly
        Call Update_List_1
        Call Tab_to_Daily_Schedules
        Call Update_CSR_Daily_Schedule
        Call Tab_to_Printable_Schedules_CSR
        Call Update_CSR_Daily_Printable_Schedule
        Call tab_from_Daily_printable_to_Employee_Info_Page
      
      
    
    '
    End Sub
    Hope that helps.

+ 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