Getting Yahoo Stock Quotes by a USer Defined Function

  • Thread starter Thread starter MS Office
  • Start date Start date
M

MS Office

Hi,
Is there a user defined function in excel which can get the share quotes
over the internet from Yahoo Finance website?
Thanks
Mukesh
 
Someone has almost certainly written a UDF that does that. But I find it
much simpler to use a sub rather than a UDF, along these lines:

1. I've established an external data range with a query of the website
2. I call, once only, a subroutine named PickUpData that includes this
statement:

ThisWorkbook.Sheets("QuerySheet").QueryTables(1).Refresh
BackgroundQuery:=False

and later on in that sub, I call this sub:

Sub DoItAgain()
Application.OnTime Now + TimeValue("00:59:00"), "PickUpData"
End Sub

In this way, I can just walk away and let Excel refresh the external data
range, in turn refresh a pivot table based on that range, save the workbook
and thus the pivot table, and wait almost another hour before it Does It
Again -- that is, before it calls PickUpData and brings new data into the
external data range. There's almost surely a more elegant method, but this
was quick and dirty and it works for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top