View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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!