View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
pete pete is offline
external usenet poster
 
Posts: 88
Default Looping Web Query

Don, this VBA returns a complied error stating "Next
without For". I named my list of last names as "myList"
Range "A2:A60".

Sub WebQ()
For Each Name In myList
With ActiveSheet.QueryTables.Add(Connection:= _
"url;http://sports.espn.go.com/nfl/players?search=" &
_
Name, Destination:=Range("C1"))
Next Name
End Sub

Also if we do get this to work, won't it keep inserting
the data retrived from the web in cell C1?

Any thoughts
Pete

-----Original Message-----
http://sports.espn.go.com/nfl/players?search=henson

this is what I got when I ask for romo. Apparently you

can't get first names
or ID?
http://sports.espn.go.com/nfl/players?search=henson
http://sports.espn.go.com/nfl/players/profile?

statsId=6624&out
So you would have to create a list and loop through the

list of last names
unless you can get the ID number for each player.
http://sports.espn.go.com/nfl/players?search=henson
http://sports.espn.go.com/nfl/players/profile?

statsId=6624&out

henson
romo
glenn
etc

sort of like this. I did not test

for each name in [mylist]
"url;http://sports.espn.go.com/nfl/players?search="&
name,Destination:=Range("C1"))
next name


--
Don Guillett
SalesAid Software

"Pete" wrote in

message
...
Here is what I got so far...

Range("C1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://sports.espn.go.com/nfl/players?
league=nfl", _
Destination:=Range("C1"))
.Name = Range("A1")
.WebTables = "2,5"
End With

Not much I know... but it shows where I am with this.
Range A1 has the player name in it. Cell C1 is where I
wnt the info to go for that particular player. The

info I
bring in just happens to take up 13 cells straight

down.

Pete
-----Original Message-----
More info along with your macro and urls for comments

--
Don Guillett
SalesAid Software

"Pete" wrote in

message
...
This one might not be possible, but I thought I

would
try.

I want to analize some data in excel that is taken

off
the web but first I need to inport the data into one
master database. My problem is that I need to inport
roughtly 55-60 different pieces or files of info and

each
piece of info is linked to another web
address "Hyperlinded". I have the Web address

(located
in
cell A1) I need to go to start with and also a list

of
names (located in Cells A2:A60) that I need to

click on
to get the appropriate info.

How can I tell the web query to goto this particular

wed
site find the first name in cell A2 open that new

address
and inport a particular chart in the first avalilbe

cell
in coloum C?

I have tried recording this and inserting loop

statment
to keep going but it just doesn't work for me.

Any help or guidance is appreciated.
Best regards,
Pete


.



.