ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Neet to get range of newly added QueryTable (https://www.excelbanter.com/excel-programming/276305-re-neet-get-range-newly-added-querytable.html)

Tom Ogilvy

Neet to get range of newly added QueryTable
 
set rng Excel.ActiveSheet.Range("B7").CurrentRegion.column s(1).cells
msgbox rng(rng.count).Row


or

Excel.Activesheet.Range("B7").End(xldown).Row

will give you the last contiguous filled cell. Assumes no blank cells If
there is nothing under the data and you may have blank cells

Excel.Activesheet.Range("B65536").End(xlup).Row

but this assumes the last row has data in column b.

--
Regards,
Tom Ogilvy


SeaCat wrote in message
...
I imported some text file into ActiveSheet like this:

QueryTables.Add
(Connection:= "TEXT;http://localhost/test.txt",
Destination:= Excel.ActiveSheet.Range("B7") )

How can I get the range of imported data, which depends on
actual lines of the text file? Thanks!




igneramos[_2_]

Neet to get range of newly added QueryTable
 
or you can use
Range("b7").QueryTable.ResultRang

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 12:22 AM.

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