title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
QueryTable.ResultRange property (Excel) |
vbaxl10.chm518090 |
|
|
7d7bde05-0e46-a282-dbdc-b2f5edcc2000 |
05/03/2019 |
medium |
Returns a Range object that represents the area of the worksheet occupied by the specified query table. Read-only.
expression.ResultRange
expression A variable that represents a QueryTable object.
The range doesn't include the field name row or the row number column.
If you import data by using the user interface, data from a web query or a text query is imported as a QueryTable object, while all other external data is imported as a ListObject object.
If you import data by using the object model, data from a web query or a text query must be imported as a QueryTable, while all other external data can be imported as either a ListObject or a QueryTable.
Use the QueryTable property of the ListObject to access the ResultRange property.
This example sums the data in the first column of query table one. The sum of the first column is displayed below the data range.
Set c1 = Sheets("sheet1").QueryTables(1).ResultRange.Columns(1)
c1.Name = "Column1"
c1.End(xlDown).Offset(2, 0).Formula = "=sum(Column1)"
[!includeSupport and feedback]