Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default HELP: Running two Macros, one before the other

If anyone knows an aswer to figuring out my problem I'd very much apperciate it.
-Bobbak


(Bobbak) wrote in message . com...
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?
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running 4 macros at once Secret Squirrel Excel Discussion (Misc queries) 2 January 31st 09 09:40 PM
Running VB macros gwtechie72 New Users to Excel 2 November 12th 07 10:04 PM
running macros from IF CJ Excel Worksheet Functions 2 April 30th 06 05:03 PM
HELP: Running two Macros, one before the other Bobbak Excel Programming 4 December 9th 03 01:27 PM
Running macros Mike[_34_] Excel Programming 1 July 17th 03 07:35 PM


All times are GMT +1. The time now is 11:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"