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

.Cells.End.Row returns wrong value

Sep 23, 2012 at 9:41 PM

Hi,

first of all thank you for this great lib. It makes my work a lot easier.

but i have a problem here. If I use .Cells.End.Row it always returns 1048576.

I don't know wether this is a bug or I'm just using it the wrong way.

here's my source:

if (!kartehinzufuegen)
            {
                testblatt.Cells["A32:C57"].Copy(testblatt.Cells["D6:F31"]);
                testblatt.Cells["A32:C57"].Clear();

                testblatt.Cells[58, 1, testblatt.Cells.End.Row, 6].Copy(testblatt.Cells[32, 1, testblatt.Cells.End.Row-26, 6]);
                testblatt.Cells[testblatt.Cells.End.Row - 26, 1, testblatt.Cells.End.Row, 6].Clear();
            }

Thanks.

Sep 28, 2012 at 3:45 PM

Use Worksheet.Dimension.End.Row instead.

Oct 11, 2012 at 5:23 PM

Thanks that was it.