View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_3_] Dick Kusleika[_3_] is offline
external usenet poster
 
Posts: 599
Default Web Query VBA help

Brock

You can do it without activating each sheet, although that works too. The
problem is in the Destination argument of the Add method

With Sheets(i).QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/q?d=t&s=" & sname,
Destination:=Sheets(i).Range("A1"))


Because you used Range("A1"), it assumes you mean on the ActiveSheet. By
qualifying the Range with the sheet as shown above, you remove any
ambiquity.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com