Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default How does one return a specific cell in a web query?

I have a web query that pulls data to Excel, but it pulls an entire table.
How can I specify that I want only, for example, the data residing in the
third cell in row 3?

Thanks much in advance.

My current code follows:

Dim qts As QueryTables
Dim qt As QueryTable

Set qts = ActiveSheet.QueryTables
Set qt = qts.Add("URL;http://www.pcquote.com/stocks/quote.php?symbol=TR",
Application.Range(ActiveCell.Address))

With qt
.AdjustColumnWidth = True
.BackgroundQuery = False
If .FetchedRowOverflow Then MsgBox "Query too large!"
.FieldNames = True
.PreserveColumnInfo = False
.PreserveFormatting = True
.WebDisableRedirections = False
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = False
.WebSelectionType = xlSpecifiedTables
.WebSingleBlockTextImport = False
.WebTables = "8"
.Refresh
End With

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How does one return a specific cell in a web query?

Qt.Destination.Offset(2,2)

possibly.

--
Regards,
Tom Ogilvy

"quartz" wrote in message
...
I have a web query that pulls data to Excel, but it pulls an entire table.
How can I specify that I want only, for example, the data residing in the
third cell in row 3?

Thanks much in advance.

My current code follows:

Dim qts As QueryTables
Dim qt As QueryTable

Set qts = ActiveSheet.QueryTables
Set qt = qts.Add("URL;http://www.pcquote.com/stocks/quote.php?symbol=TR",
Application.Range(ActiveCell.Address))

With qt
.AdjustColumnWidth = True
.BackgroundQuery = False
If .FetchedRowOverflow Then MsgBox "Query too large!"
.FieldNames = True
.PreserveColumnInfo = False
.PreserveFormatting = True
.WebDisableRedirections = False
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = False
.WebSelectionType = xlSpecifiedTables
.WebSingleBlockTextImport = False
.WebTables = "8"
.Refresh
End With



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default How does one return a specific cell in a web query?

I don't think you can do that. You can use dataimport external dataedit
queryselect the table onlyimport and after the 1st time then just use this
to refresh instead of re-creating each time which involves deleting lines
first and then deleting names, etc.

ActiveSheet.QueryTables(1).Refresh BackgroundQuery:=False

the copy the desired cell somewhere else or just have it referred to in
another sheet using INDIRECT.

--
Don Guillett
SalesAid Software

"quartz" wrote in message
...
I have a web query that pulls data to Excel, but it pulls an entire table.
How can I specify that I want only, for example, the data residing in the
third cell in row 3?

Thanks much in advance.

My current code follows:

Dim qts As QueryTables
Dim qt As QueryTable

Set qts = ActiveSheet.QueryTables
Set qt = qts.Add("URL;http://www.pcquote.com/stocks/quote.php?symbol=TR",
Application.Range(ActiveCell.Address))

With qt
.AdjustColumnWidth = True
.BackgroundQuery = False
If .FetchedRowOverflow Then MsgBox "Query too large!"
.FieldNames = True
.PreserveColumnInfo = False
.PreserveFormatting = True
.WebDisableRedirections = False
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = False
.WebSelectionType = xlSpecifiedTables
.WebSingleBlockTextImport = False
.WebTables = "8"
.Refresh
End With



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
Return the filtered value into a specific cell Sal Excel Worksheet Functions 5 April 5th 23 01:23 PM
Cell to return a specific value if left blank Sdtex Excel Worksheet Functions 6 May 15th 09 06:30 PM
How do you use sumproduct to return specific cell data? Brian Excel Worksheet Functions 2 September 14th 07 07:42 PM
How to return the row # of an expression in specific array of cell Rado Excel Worksheet Functions 2 June 27th 06 04:59 PM
Select cell containing specific text &return value from another ce plf100 Excel Worksheet Functions 4 November 16th 05 01:57 PM


All times are GMT +1. The time now is 04:25 AM.

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"