Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number of Excel Rows

Status
Not open for further replies.

JDU

Technical User
Dec 23, 2002
182
US
I have a csv file that gets created as a result of an export. How can I figure out how many rows are populated since I have to use it in a code

eg.
For rwindex = 10000 (I wouldn't know this number) To 1 Step -1
 
If your data are in a spreadsheet, you can get the number of rows with the .UsedRange.Rows.Count property.

If your data are only in a file and you are reading individual records, use a Do While not end-of-file type of logic. You don't need the number of rows. (Or if your really do, pre-process the file by counting the number of records in a do while not end-of-file loop.)
 
Frederico: Indeed, yes. I was very sorry to see it go. Zathras was my favorite character. I know exactly how he feels.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top