teach_me_VBA
New Member
- Joined
- Dec 10, 2007
- Messages
- 11
Could someone please help me with a problem I'm currently having? I have a list of stocks I would like to do some analysis on, but would like to create a VBA that does the legwork. I have created a VBA that downloads stock prices, but can only do one at a time. I have also included an embedded code to insert a row when I refresh the data and populate the cells accordingly.
The issue is that I would like to figure out a way to take the list of stocks I have and do all at once instead of one at a time. Is that possible and can anyone help with how this can be done? Below is what I'm trying to do.
On sheet1 I have a list of stocks, let's say
MSFT
GOOG
AXP
AAPL
I would like to be able to download the historical stock prices based on the following parameters in new tabs with the stock name as the name of the new tab:
Date
Open
High
Low
Close
Volume
Adjusted Close
I have my analysis set-up so once this is done, I can drop in the extra code I've already created and do back testing. I noticed that there is a workbook here that does this, but would really like to get the code so I know how to create myself in the future.
I know the VBA queries I've already created can be done together in one query, but since I'm new at writing VBA, I would like to do this in a methodical step-by-step process. And since I don't know how to pull historical stock data into new tabs and changing the tab name to the stock name, I would like to figure out how to do this first. Any help would be greatly appreciated. Thanks.
Ryan
The issue is that I would like to figure out a way to take the list of stocks I have and do all at once instead of one at a time. Is that possible and can anyone help with how this can be done? Below is what I'm trying to do.
On sheet1 I have a list of stocks, let's say
MSFT
GOOG
AXP
AAPL
I would like to be able to download the historical stock prices based on the following parameters in new tabs with the stock name as the name of the new tab:
Date
Open
High
Low
Close
Volume
Adjusted Close
I have my analysis set-up so once this is done, I can drop in the extra code I've already created and do back testing. I noticed that there is a workbook here that does this, but would really like to get the code so I know how to create myself in the future.
I know the VBA queries I've already created can be done together in one query, but since I'm new at writing VBA, I would like to do this in a methodical step-by-step process. And since I don't know how to pull historical stock data into new tabs and changing the tab name to the stock name, I would like to figure out how to do this first. Any help would be greatly appreciated. Thanks.
Ryan