How to determine a range size

  • Thread starter Thread starter cici
  • Start date Start date
C

cici

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?
 
-----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
 
Back
Top