View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Looping: Search Range in Multiple Selected Worksheets, Copy/Paste

Thanks to everyone for all the help before. I have one more question. I
have a macro that creates several dozen worksheets (all with publicly traded
stock information). The worksheets dont exist until I query
finance.yahoo.com and import all information from this web site. When the
macro is executed, a spreadsheet is created for each stock, and the data is
imported to each relevant sheet. Now I get more data than I need, so I am
trying to figure out a way to reference each sheet (it has to be a loop) and
identify, or 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)).

Something like...search...ok "Forward P/E (1 yr):" is in column D and row 1
(it may not always be here, but it will be close; thats why I have to search
for it)...shift right one cell...copy/paste that value onto a sheet called
"Summary Sheet" in cell c3, then loop back and get the next "Forward P/E (1
yr):" in the next sheet. When this column is done, start looking for "PEG
Ratio (5 yr expected):", "Annual EPS Est (Aug-07):", the corresponding value,
etc.

Any ideas? Some help would be much appreciated. When I have a full working
model, I will post my code here for the benefit of others€¦

Regards,
RyGuy