This project has moved and is read-only. For the latest updates, please go here.

How to find the last column of a row ?

Nov 7, 2013 at 9:20 AM
Edited Nov 7, 2013 at 9:30 AM
Hello,

How I can find the last column with a value of a row ?

I can't use worksheet.Dimension.End.Column because the result is the last row of the whole worksheet.

For example, I would like to have the last row with a value of the seventh column.

Thank you,

Jahz
Nov 7, 2013 at 10:28 AM
There is no automatic way to do that. Try a linq query over epplus cells.

Regards,
Thiago
Nov 7, 2013 at 11:57 AM
Edited Nov 7, 2013 at 11:59 AM
I tried linq query but I did not found how to do.

I tried something like that :
        Dim cells = From c
                     In _ws2.Cells("A:" & _currentRow)
                     Where c.Value IsNot Nothing And c.Text.ToString() <> ""
Can you help me ?

Best regards,

Jahz

PS : Sorry for my english, I am French.
Nov 7, 2013 at 12:24 PM
Hi,

There are some examples in our repository. Please take a look at https://epplus.codeplex.com/SourceControl/latest#SampleApp/Sample8.cs