Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
|
|||
|
|||
HELP: Running two Macros, one before the other
I have this Excel spreadsheet in which I want to automate, I have two
macros once called Macro_GetData, and Macro_FormatData. Both these Macros work fine, but when I try to automate them it runs the 2nd Macro before the 1st Macro is even finish. I tried to use the "Application.Wait" command but that just stopped the macros. What I want the macro to do is to run the first Macro (Macro_GetData) and when that's finished then run the second Macro (Macro_FormatData). How can I go about doing this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: Running two Macros, one before the other
Public Sub AutomatedProc()
Call Macro_GetData Call Macro_FormatData End Sub run the proc AutomatedProc which will run the two procs one after the other Patrick Molloy Microsoft Excel MVP -----Original Message----- I have this Excel spreadsheet in which I want to automate, I have two macros once called Macro_GetData, and Macro_FormatData. Both these Macros work fine, but when I try to automate them it runs the 2nd Macro before the 1st Macro is even finish. I tried to use the "Application.Wait" command but that just stopped the macros. What I want the macro to do is to run the first Macro (Macro_GetData) and when that's finished then run the second Macro (Macro_FormatData). How can I go about doing this? . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: Running two Macros, one before the other
Patrick, what you suggested didn't work. I need the second macro to
run once the first macro is completed. In other words when the first marco runs, once it's gets the data from the Import External Data (Web Query), and fills out the worksheet then and only then have the macro run the second macro. Here is the initial code that I have: Sub Auto_Open() Application.Run "'AgentStats (Auto).xls'!Macro_GetData" 'Calls the Web Query Application.Run "'AgentStats (Auto).xls'!Macro_FormatData" 'Formats the Data End Sub Now the Macros Macro_GetData, and Macro_FormatData work perfectly when I run them manually. What I need to figure out it to how to make work that when the data from the Macro_GetData is loaded on the worksheet to then run the Macro_FormatData. "Patrick Molloy" wrote in message ... Public Sub AutomatedProc() Call Macro_GetData Call Macro_FormatData End Sub run the proc AutomatedProc which will run the two procs one after the other Patrick Molloy Microsoft Excel MVP -----Original Message----- I have this Excel spreadsheet in which I want to automate, I have two macros once called Macro_GetData, and Macro_FormatData. Both these Macros work fine, but when I try to automate them it runs the 2nd Macro before the 1st Macro is even finish. I tried to use the "Application.Wait" command but that just stopped the macros. What I want the macro to do is to run the first Macro (Macro_GetData) and when that's finished then run the second Macro (Macro_FormatData). How can I go about doing this? . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
HELP: Running two Macros, one before the other
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Running 4 macros at once | Excel Discussion (Misc queries) | |||
Running VB macros | New Users to Excel | |||
running macros from IF | Excel Worksheet Functions | |||
HELP: Running two Macros, one before the other | Excel Programming | |||
Running macros | Excel Programming |