Excel RowCount

  • Thread starter Thread starter John Barr
  • Start date Start date
J

John Barr

I am using C# to import data from an Excel File, and
trying only want to get a rowcount of rows with data in
them, not 65536. Is there a way to do this, or do I need
to cycle through all the rows to determine if data
exists..?
 
John,

I think that what you want to do is check the UsedRange property for the
Worksheet that you are looking at. Granted, you will have to make sure you
don't double-count rows, as the range that is returned to you can have
multiple ranges in it with rows overlapping. This should work for you
though.

Hope this helps.
 
Back
Top