View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Randy Harmelink Randy  Harmelink is offline
external usenet poster
 
Posts: 122
Default Import from finance.yahoo.com

With the add-in I mentioned in the other message, you could get the
PEG ratio for IBM with this formula:

=RCHGetElementNumber("IBM",945)

It is one of thousands that are preprogrammed. Or, you could use
another function to do custom extractions yourself. For example, the
PEG ratio can also be retrieved with:

=RCHGetTableCell("http://finance.yahoo.com/q/ks?s=IBM",1,"PEG Ratio")

On Mar 19, 10:03 am, ryguy7272
wrote:
Yes, yes, Yes, search the rows for the text that defines the data... I
thought of that too. How do you do it?

I have a macro that creates spreadsheets and then imports the data to the
relevant sheet. I need to loop through each sheet and find certain strings,
such as "Forward P/E (1 yr):", "PEG Ratio (5 yr expected):", "Annual EPS Est
(Aug-07):" (the (Aug-07) part is certain to create obvious problems unless I
can set this up to search for "ESP" within the string), etc. Then I have to
find the value to the right of this string (perhaps offset (0 ,1)).
Everything is summarized on my "Summary Sheet". I can't tell the Summary
Sheet to reference other sheets because they haven't been created yet, but
after they are created I want to identify the Forward P/E, etc. on each sheet
and copy/past each value to my Summary Sheet... Any ideas...