Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Looping Web Query

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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Looping Web Query

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



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Looping Web Query

..name simply refers to the name of the query (unnecessary anyway) so it
wouldn't help you. I will take a look at your url to see if I can help.

--
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



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Looping Web Query

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/player...atsId=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/player...atsId=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



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
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


.



.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Looping Web Query

1. You forgot that my list is a range so you need range("mylist") or
[mylist]
2. I named a sheet "Data" and used this and it worked BUT only if there was
only ONE player with that last name. Otherwise, you get the list of players
with that last name. I guess you would have to get the player ID and make an
offset from mylist. OR???
3. Yes, it will overwrite. You need to extract what you want from within the
for/next to another sheet
4. you might want to play with the parameters such as .savedata=true

Let me know how it works out.

Sub WebqDon()
For Each Name In [mylist]
myurl = "http://sports.espn.go.com/nfl/players?search=" & Name
With Sheets("Data").QueryTables.Add(Connection:="URL;" & myurl, _
Destination:=Sheets("Data").Range("c4"))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
'code to extract data needed to another sheet.
Next Name
End Sub

--
Don Guillett
SalesAid Software

"Pete" wrote in message
...
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


.



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Web Query with looping variables in the URL titus.hanke Excel Programming 6 July 5th 04 03:49 PM
looping every third row Jason Hancock Excel Programming 5 July 1st 04 08:00 PM


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"