471,330 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

How to get the number of nonempty rows in excel application?

Hi, there,

I have an xls file, and need to get the number of nonempty rows from one
worksheet. How to know what is the last line of this worksheet?

I am using Microsoft Excel 9.0 library, Excel 2000, and C#.

Thanks,

Gary
Dec 30 '05 #1
1 8997
Gary,

Check out the UsedRange property on the Worksheet. It will give you the
smallest grid on the worksheet which has all the content in it. However,
this might mean there are empty spaces in the content, but from there, you
can search it to filter out or find your items.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Gary" <Ga**@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com...
Hi, there,

I have an xls file, and need to get the number of nonempty rows from one
worksheet. How to know what is the last line of this worksheet?

I am using Microsoft Excel 9.0 library, Excel 2000, and C#.

Thanks,

Gary

Dec 30 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by =?Utf-8?B?UHJpeWE=?= | last post: by
reply views Thread by Christopher | last post: by
1 post views Thread by evenlater | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.