By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,673 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,673 IT Pros & Developers. It's quick & easy.

Excel RowCount

P: n/a
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..?
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"John Barr" <jb***@toobrands.com> wrote in message
news:01****************************@phx.gbl...
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..?

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.