We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Obtain MaxRow/MaxColumn from a particular row/column

hi, is there any method where we can find the maxRow or maxColumn from particular row/column which contain ‘Data’(not empty cell).


See the following sample code for your reference:
Sample code:

Workbook workbook = new Workbook("e:\\test\\Book1.xlsx");
Worksheet sheet = workbook.Worksheets[0];
Cells cells = sheet.Cells;

//Get the last cell in the 4th column (D)
Aspose.Cells.Cell endCellColumn = cells.EndCellInColumn(3);
int maxrow = endCellColumn.Row;
int maxcol = endCellColumn.Column;

//Get the last cell in the first row
Aspose.Cells.Cell endCellRow = cells.EndCellInRow(0); 
//Similarly you may evaluate max row and max column here.

Hope, this helps a bit.