Excel row count

  • Thread starter Thread starter marianowic
  • Start date Start date
M

marianowic

Hello.
I'm trying to get a real number of used (where is any data) rows in a
Excel file in a C# code.
I found some examples abount Excel.Range but it still isn't good.
Does anyone have any ide how to do it??
Thanks for help.

PS:
The aim is to delete all rows (empty and filled) that do not fit to
some restrictions and then save the file to txt format. Maybe it will
help. Thanks
 
marianowic,

You should probably automate excel to do this. On the worksheet that
you want to find the number of rows of, you probably want to check the
UsedRange propery. This will return a range of the sheet that is used.
From there, you can figure out the number of rows in the sheet.
 
its very hard to detremine it, because every range can have different row
count, So what you mean,

Meanwhile, you can use that : Range.Count
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top