Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default How to find the range of a web query on a Excel worksheet

I have a web query on one of the worksheet and I want VBA to obtain
the range in which the web query as populated the results from VBA.

Can you kindly advise how I can determine the range of cells populated
by the web query.

Also, in general when we have a range of values populated on a Excel
worksheet how can we progammatically determine the range of cells
populated in the worksheet.

Thanks
Belinda
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default How to find the range of a web query on a Excel worksheet

Hi Belinda;

After the recordset has returned use this code.

'Select a cell somewhere in the range probably

Range("A1").Select

'Then use the current region method

ActiveCell.CurrentRegion.Select

'Then get the address

MyRange = Selection.Address

'The values for Address are read only.

Thanks,

Greg

-----Original Message-----
I have a web query on one of the worksheet and I want VBA

to obtain
the range in which the web query as populated the results

from VBA.

Can you kindly advise how I can determine the range of

cells populated
by the web query.

Also, in general when we have a range of values populated

on a Excel
worksheet how can we progammatically determine the range

of cells
populated in the worksheet.

Thanks
Belinda
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to find the range of a web query on a Excel worksheet

You don't have to select of course.

set rng = Range("A1").CurrentRegion
msgbox rng.Address(external:=True)

--
Regards,
Tom Ogilvy

"Gjones" wrote in message
...
Hi Belinda;

After the recordset has returned use this code.

'Select a cell somewhere in the range probably

Range("A1").Select

'Then use the current region method

ActiveCell.CurrentRegion.Select

'Then get the address

MyRange = Selection.Address

'The values for Address are read only.

Thanks,

Greg

-----Original Message-----
I have a web query on one of the worksheet and I want VBA

to obtain
the range in which the web query as populated the results

from VBA.

Can you kindly advise how I can determine the range of

cells populated
by the web query.

Also, in general when we have a range of values populated

on a Excel
worksheet how can we progammatically determine the range

of cells
populated in the worksheet.

Thanks
Belinda
.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default How to find the range of a web query on a Excel worksheet

Would this work for you?

Sub FindQueryAddress()
Dim QueryAddress As String
QueryAddress = ActiveSheet.QueryTables(1).ResultRange.Address(Fal se,
False)
End Sub


HTH
Dana DeLouis


"Belinda" wrote in message
om...
I have a web query on one of the worksheet and I want VBA to obtain
the range in which the web query as populated the results from VBA.

Can you kindly advise how I can determine the range of cells populated
by the web query.

Also, in general when we have a range of values populated on a Excel
worksheet how can we progammatically determine the range of cells
populated in the worksheet.

Thanks
Belinda



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
query with formula/macro to find text in worksheet and delete it James Excel Worksheet Functions 3 February 8th 08 06:59 AM
QUERY data range to populate separate worksheet? Greg Purnell[_2_] Excel Worksheet Functions 3 April 5th 07 01:49 PM
excel - access query - date range mxp Excel Discussion (Misc queries) 1 January 31st 06 03:44 PM
Sql query on a range in the opened worksheet Shaul Bel Excel Programming 1 December 31st 03 04:31 PM
Excel query creates named range Dick Kusleika Excel Programming 2 August 18th 03 06:49 PM


All times are GMT +1. The time now is 04:15 PM.

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"