How update range after web query?

  • Thread starter Chris Shearer Cooper
  • Start date
C

Chris Shearer Cooper

I've got a spreadsheet that loads its data from a web page as a web
query/external data range. The amount of data on the web page varies, what
I want is to have a range (which I can then chart or whatever) that sets
itself to "all the data in column C" (for example).

How can I make the range "fit itself" to the available data? Is there some
fancy kind of range that does this? Or, is there a way to have a macro
automatically run after the web query (and then I can make the macro do the
right thing)?

Thanks!
Chris
 
D

Don Guillett

try using a defined name for the range.
insert>name>define>colC>refers to
=offset($c$1,0,0,counta($c:$c),1)
 
D

Dick Kusleika

Chris

You may be able to use the ResultRange property of the QueryTable. If you
only want column C and QT is cols A - F, for example, you can use

Set Rng = Sheet1.QueryTables(1).ResultRange.Columns(3)

and Rng will be the appropriate number of rows.
 
Top