This project has moved. For the latest updates, please go here.

Getting End of Rows

Aug 19, 2012 at 10:05 AM
 

I use EPPlus to read a worksheet. In this worksheet, the data I need is in columns B-D. In column A there are static values, that I would ignore. The values in col A are filled in till Row 1000. But, the data I need will be there only till, say for example Row 450. Currently I use
int endRow = workSheet.Dimension.End.Row; to calculalate the last row to read, but that returns me a value of 1000. Is there a way for me to get the value of endRow to be 450, ignoring col A.

TIA Sue.

Editor
Aug 21, 2012 at 2:10 PM

worksheet.Dimesion.End will always return the bottom right cell, but you can use a linq query. Take a look at Sample8

 

http://epplus.codeplex.com/SourceControl/changeset/view/90aa5cee8750#SampleApp%2fSample8.cs