Scott123_xyz
New Member
- Joined
- Jan 19, 2020
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I am a novice in vba and am starting to learn a few things, but i'm stumped on how to do the following:
Essentially, I have a workbook that contains a list of stocks (range a8 to a200) on a worksheet called "summary". Each stock in the list has its own worksheet and I want to download financial data for each stock and store it in the corresponding worksheet. following is a specific example:
The workbook is titled: StockData
The worksheet is titled: RY.Xtse
The appropriate URL is stored in range("b3") of each worksheet. For this worksheet the url is as follows: Growth, Profitability, and Financial Ratios for Royal Bank of Canada (RY) from Morningstar.com
Here's the challenge: I want to start with the first stock on the list from my summary worksheet. Then I want to go its respective stock sheet (see sample above) and open the URL indicated in range b3 of the worksheet (see sample indicated above), click on the export button from the webpage which creates a CSV file. Once the CSV file opens, i want to copy (range a1: L11) from the CSV file and paste it in range ("a10") of the respective stock worksheet. Then I want to close the CSV file and go to the next worksheet on the list from my summary worksheet, and repeat the process for that stock until all stocks in the list from my "summary" worksheet has had their respective info saved. I have approx. 200 stocks I want to do this for every month
Essentially, I have a workbook that contains a list of stocks (range a8 to a200) on a worksheet called "summary". Each stock in the list has its own worksheet and I want to download financial data for each stock and store it in the corresponding worksheet. following is a specific example:
The workbook is titled: StockData
The worksheet is titled: RY.Xtse
The appropriate URL is stored in range("b3") of each worksheet. For this worksheet the url is as follows: Growth, Profitability, and Financial Ratios for Royal Bank of Canada (RY) from Morningstar.com
Here's the challenge: I want to start with the first stock on the list from my summary worksheet. Then I want to go its respective stock sheet (see sample above) and open the URL indicated in range b3 of the worksheet (see sample indicated above), click on the export button from the webpage which creates a CSV file. Once the CSV file opens, i want to copy (range a1: L11) from the CSV file and paste it in range ("a10") of the respective stock worksheet. Then I want to close the CSV file and go to the next worksheet on the list from my summary worksheet, and repeat the process for that stock until all stocks in the list from my "summary" worksheet has had their respective info saved. I have approx. 200 stocks I want to do this for every month