GeneralShamu
Board Regular
- Joined
- Jul 6, 2007
- Messages
- 127
I am trying to create a macro that will need to run a list of Tickers through a model with many other macros. To do this I created a for loop that works properly but before anything cna be run there must be a time delay. The model needs about 20 seconds for all Bloomberg data to be populated. To try and solve this I entered the following line of code:
Application.Wait (Now + TimeValue("00:00:20"))
but this seemed to only stop the macro and everything else from running...so no data could be populated.
To fix this I cahnged the code to:
Application.OnTime Now + TimeValue("00:00:20"), "CopyStockInfoDynamicToStatic"
The name in " " is just the name of the macro. When I run the macro with this line of code however, it seems to go passed this line and wait 20 seconds before it runs that macro.
How do I get my macro to stop for 20 seconds, let Excel continue to populate data from Bloomberg, and than, after 20 seconds, run the CopyStock... macro?
Application.Wait (Now + TimeValue("00:00:20"))
but this seemed to only stop the macro and everything else from running...so no data could be populated.
To fix this I cahnged the code to:
Application.OnTime Now + TimeValue("00:00:20"), "CopyStockInfoDynamicToStatic"
The name in " " is just the name of the macro. When I run the macro with this line of code however, it seems to go passed this line and wait 20 seconds before it runs that macro.
How do I get my macro to stop for 20 seconds, let Excel continue to populate data from Bloomberg, and than, after 20 seconds, run the CopyStock... macro?