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

I've got a spreadsheet that contains a number of different web querie
for MLB stats from espn.com. I'm trying to create a macro that wil
refresh the data for these queries. Here's a visual of what it look
like:

TEAM NAME

stats from web query
stats from web query
stats from web query


TEAM NAME

stats from web query
stats from web query
stats from web query

The data from the web queries do not always stay the same size. What
want the macro to do is this:

find "TEAM NAME", select the cell that is two cells below "TEAM NAME"
and refresh the data from the web query.

I'm having trouble figuring out the "select the cell that is two cell
below 'TEAM NAME' " part. Any help would be appreciated

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Web Query/Cell Reference

hawkeyes2002

How many web queries do you have on your sheet? Two? Do you want to find a
specific team name and only update the stats for that team? Do you want to
update all the web queries on the sheet? Do the locations of TEAM NAME
change because the web queries are expanding and contracting?

Here's a couple of ideas. If you answer the above questions, I can give you
more specific help.

To update a query
Sheet1.QueryTables(1).Refresh

To update all queries
ThisWorkbook.RefreshAll

If TEAM NAME moves, I would create range names (Insert-Name-Define) for the
team name cells. Then you can find their queries like
Range("Team1").Offset(2,0).QueryTable.Refresh

where Team1 is the a named range.

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

"hawkeyes2002 " wrote in
message ...
I've got a spreadsheet that contains a number of different web queries
for MLB stats from espn.com. I'm trying to create a macro that will
refresh the data for these queries. Here's a visual of what it looks
like:

TEAM NAME

stats from web query
stats from web query
stats from web query


TEAM NAME

stats from web query
stats from web query
stats from web query

The data from the web queries do not always stay the same size. What I
want the macro to do is this:

find "TEAM NAME", select the cell that is two cells below "TEAM NAME",
and refresh the data from the web query.

I'm having trouble figuring out the "select the cell that is two cells
below 'TEAM NAME' " part. Any help would be appreciated.


---
Message posted from http://www.ExcelForum.com/



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
Reference web query data in seperate worksheet AmyLRuck Excel Worksheet Functions 1 October 4th 08 04:46 PM
how do i reference a cell with url for web query import? fkendrick Excel Worksheet Functions 1 January 2nd 07 12:23 PM
How do I reference a Web Query on another sheet? ReAnna New Users to Excel 4 April 15th 06 09:43 AM
Query about Last Cell reference. Pank Mehta Excel Discussion (Misc queries) 3 May 9th 05 10:47 AM
Microsoft Query - how to reference a cell value in a filter Dan Excel Programming 1 December 13th 03 01:28 AM


All times are GMT +1. The time now is 05:28 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"