View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Running two Macros, one before the other

Bobbak,
It sounds like the first macro "calls" the second macro before it should.
Try this: look at the code in Macro_GetData and move the line with
"Macro_FormatData" in it to the end of Macro_GetData.

If that screws it up or you can't find the applicable line then you had
better post the code.

Regards,
Jim Cone
San Francisco, CA

----- Original Message ----- ----------
From: "Bobbak"
Newsgroups: microsoft.public.excel.programming,microsoft.publi c.excel.misc
Sent: Tuesday, December 02, 2003 12:04 PM
Subject: 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 entirely.
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).
The second Macro cannot work unless the first macro is completed. How
can I go about doing this?