View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter Atherton[_30_] Peter Atherton[_30_] is offline
external usenet poster
 
Posts: 2
Default How to determine a range size


-----Original Message-----
I want to know the number of data lines in an imported
file (text file), so I can define an exact range using

VBA
after it's imported. Is there a function I can use?
.

After the file is Imported

'get in the range
Range("A2").select
nr = activecell.currentregion.rows.count

or

nr = application.worksheetfunction.counta(Range("A:A"))

Regards
Peter