Can Web Query retrieve a single HTML table cell?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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)?
 
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...
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top