LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Import 1, 3, 6, and 12 month returns for a list of mutual funds

Does anyone know of a relatively easy way to get 1, 3, 6, and 12 month
returns for a list of mutual fund symbols, from finance.yahoo.com?

For instance, if I have the following in A3:A7:
RPBAX
TRBCX
PRWCX
PRCOX
PRDMX

Range B2:E2 = 1-month, 3-months, 6-months, 12-months.

Now, for RPBAX, by right-clicking on the page and selecting €˜View Source,
in the HTML, I see this:
<td class="yfnc_datamodlabel1"1-Month</td<td class="yfnc_datamoddata1"
align="right"4.05</td
<td class="yfnc_datamodlabel1"3-Month</td<td class="yfnc_datamoddata1"
align="right"6.37</td
<td class="yfnc_datamodlabel1"1-Year</td<td class="yfnc_datamoddata1"
align="right"31.03</td

I guess I can loop through the list of funds, something like this:

Sub Import()
Dim str1 As String
Dim c As Range

For Each c In Sheets("Sheet1").Range("A3:A7")
str1 = "URL;http://finance.yahoo.com/q/pm?s=" & _
c.Value
With ActiveSheet.QueryTables.Add(Connection:=str1 _
, Destination:=Range("B3"))
.Name = str1
.Name = "ks?s=c.Value"
.WebFormatting = xlWebFormattingNone
.WebTables = "24"
.Refresh BackgroundQuery:=False
End With
Next c

End Sub

This doesnt work; nothing is imported, and even if it were, the Range("B3")
is where I need to start, but then I need to something like offset(0,1),
Import 3-months, offset(0,1), Import 6-months, and offset(0,1), Import
12-months. Then something like offset(1,-4) to get to cell A4, and find the
returns for that fund. None of this logic is coded into the macro yet.
Thats probably not too hard to do, but Im not exactly sure how to
incorporate it into the URL. Also, I dont see the 6-month return anywhere
on the page. So, Im thinking Yahoo doesnt cover this metric, right. I
actually used to work for Yahoo, on the corporate finance side not on the
investment side. I suspect all these metrics come straight form the stock
exchanges, right.

I could forgo the 6-month metric if it doesnt exist, but would like to pick
it up if there is a way. In any event, how would I code the macro above to
do what I described?


Thanks,
Ryan--


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
 
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
Future Value of Mutual Funds Puzzled Investor Excel Discussion (Misc queries) 1 December 29th 07 11:56 AM
Investing,Mutual Funds Formula? Crackles McFarly Excel Worksheet Functions 18 August 22nd 07 04:56 AM
Function that returns the month name Rapunzel Excel Worksheet Functions 2 January 24th 07 08:20 AM
where to find excel template for ROI stocks/mutual funds Treasur2 Excel Discussion (Misc queries) 4 April 22nd 06 11:00 PM
When using MONTH function on Blank Cell!! Returns Month=Jan! mahou Excel Discussion (Misc queries) 6 January 9th 06 02:46 AM


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

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

About Us

"It's about Microsoft Excel"