ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Query Table problem (https://www.excelbanter.com/excel-programming/310715-query-table-problem.html)

Ron[_28_]

Query Table problem
 
Hi guys,

I have 2 query tables in one worksheet, in fact there's only 2 tables in
the whole workbook.

Here,s the code I use to refresh the table values..


Sheets("WEB QUERY").QueryTables(1).Connection =
"URL;http://lite.betfair.com/lite_view_market.asp?id=" & Range("y4")
Sheets("WEB QUERY").QueryTables(1).Refresh
Sheets("WEB QUERY").QueryTables(2).Connection =
"URL;http://lite.betfair.com/lite_view_market.asp?id=" & Range("y5")
Sheets("WEB QUERY").QueryTables(2).Refresh

The values in cells Y4 & Y5 are event numbers from the website data tables.

The problem being is that each day I keep having to swap the two ("y4") and
("y5") values around in this code.

Seemingly on a morning table (1) becomes table(2) and vice versa each
morning.

The cell values in Y4 & Y5 change throught the day, and they work perfectly
with the code that changes them.

It only happens once a day on the first refresh, after that they are fine.

I've tried naming the tables and substituting QueryTables(1) for
QueryTables(nameOne) etc but this didn't solve it, or I had the syntax
wrong.

Any help on this would be much appreciated.

Thanks,

Ron

Ron[_28_]

Query Table problem
 
Hi Guys,

Im still struggling with this problem, any ideas at all?



Ron


All times are GMT +1. The time now is 03:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com