+ Reply to Thread
Results 1 to 3 of 3

how to automatically download info from yahoo finance into excel

  1. #1
    Pete Moss
    Guest

    how to automatically download info from yahoo finance into excel

    I want to have excel automatically go out and download information
    from yahoo finance on a daily basis. I'm an excel user with no
    programing experience. Is there a kb article or other source of
    detailed instruction on how to achieve this goal.

    Thanks for you help.
    pm.

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi Pete,
    Below is the macro :
    Sub GetYQuotes()
    Base01 = "http://finance.yahoo.com/d/quotes.csv?s="
    Base02 = "&f=sl1d1t1c1ohgv&e=.csv"
    sURL = ""
    SymString = ""

    LastRow = Cells(65536, 1).End(xlUp).Row


    For i = 1 To LastRow
    SymString = SymString & Cells(i, 1) & " "
    Next i
    sURL = Base01 & SymString & Base02
    Workbooks.Open sURL
    Set rngSource = Cells(1).CurrentRegion
    x = rngSource.Rows.Count
    y = rngSource.Columns.Count
    With ThisWorkbook.Sheets(1)
    Set rngDest = Range(.Cells(1, 1), .Cells(x, y))
    End With
    rngDest.Value = rngSource.Value
    ActiveWorkbook.Close SaveChanges:=False
    End Sub


    You have to arrange your worksheet with no titles in row 1 and using
    column A to type in your symbols
    ORCL for Oracle, GE for General Electric ...


    HTH
    Cheers
    Carim

  3. #3
    Carim
    Guest

    Re: how to automatically download info from yahoo finance into excel

    Hi Pete,
    Below is the macro :
    Sub GetYQuotes()
    Base01 = "http://finance.yahoo.com/d/quotes.csv?s="
    Base02 = "&f=sl1d1t1c1ohgv&e=.csv"
    sURL = ""
    SymString = ""

    LastRow = Cells(65536, 1).End(xlUp).Row

    For i = 1 To LastRow
    SymString = SymString & Cells(i, 1) & " "
    Next i
    sURL = Base01 & SymString & Base02
    Workbooks.Open sURL
    Set rngSource = Cells(1).CurrentRegion
    x = rngSource.Rows.Count
    y = rngSource.Columns.Count
    With ThisWorkbook.Sheets(1)
    Set rngDest = Range(.Cells(1, 1), .Cells(x, y))
    End With
    rngDest.Value = rngSource.Value
    ActiveWorkbook.Close SaveChanges:=False
    End Sub

    You have to arrange your worksheet with no titles in row 1 and using
    column A to type in your symbols
    ORCL for Oracle, GE for General Electric ...

    HTH
    Cheers
    Carim


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1