ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can Web Query retrieve a single HTML table cell? (https://www.excelbanter.com/excel-discussion-misc-queries/84974-can-web-query-retrieve-single-html-table-cell.html)

Joe Francisco

Can Web Query retrieve a single HTML table cell?
 
Is there a way to use Web Query to get just one data point (contents of one
table cell) from an HTML page (instead of the whole table)? Of course you can
get the table and then create a reference to the desired data, but is there
any way to get that one data point directly via the Query (e.g., some obscure
setting you can manually insert into the .iqy file)?


[email protected]

Can Web Query retrieve a single HTML table cell?
 
I don't think so. What I have found that works for me is recording a
macro that deletes all the information you dont want leaving the cell
that you do. You can then fire off the macro using a button etc. I am
new to this myself so I cannot offer you all of your options, but it
may be a start...


Joe Francisco

Can Web Query retrieve a single HTML table cell?
 
Thanks for the tip! I'll try it, at least as a temporary solution. The
problem is that running the Web Query replaces the data in adjacent cells, as
I'm sure you know. I'm sure there's a way around this--e.g. by having the
macro insert surrounding rows and columns and then delete them, leaving only
the desired data point--but I sure would like to avoid that mess.

If anyone knows a better way (besides similarly complicated workarounds like
using a helper sheet), I'd really like to know about it.

" wrote:

I don't think so. What I have found that works for me is recording a
macro that deletes all the information you dont want leaving the cell
that you do. You can then fire off the macro using a button etc. I am
new to this myself so I cannot offer you all of your options, but it
may be a start...



Joe Francisco

Can Web Query retrieve a single HTML table cell?
 
Correction:

I see now that refreshing the query doesn't overwrite adjacent data...but it
still recreates the new cells for the entire table, which you then have to
delete. This means another macro for refreshing the cell, and yet another one
to run that one repeatedly if you want to update an entire column of data.

I can see that it would work, but I think a helper sheet would be less
complicated. No need for any macros, and to refresh all the data, you can
just hit the "Refresh All" toolbar button.


" wrote:

I don't think so. What I have found that works for me is recording a
macro that deletes all the information you dont want leaving the cell
that you do. You can then fire off the macro using a button etc. I am
new to this myself so I cannot offer you all of your options, but it
may be a start...




All times are GMT +1. The time now is 09:24 AM.

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