Get Max Column Index in Row and Max Row Index in Column

Possible Usage Scenarios

When you only need to manipulate some data on the rows or columns, you need to know the data range of those rows and columns. Aspose.Cells for Node.js via C++ offers this feature. To obtain the maximum column index on a row, you can call the Row.getLastCell() and Row.getLastDataCell() methods, and then use the Cell.getColumn() method to obtain the maximum column index and the maximum data column index. However, to obtain the maximum row index and the maximum data row index on a column, you need to create a range for the column, traverse the range to find the last cell, and finally call the Cell.getRow() method on that cell.

Aspose.Cells for Node.js via C++ provides the following properties and methods to help you achieve your goals.

Get Max Column Index in Row and Max Row Index in Column

This example shows how to:

  1. Load the sample file.
  2. Get the row for which you need to obtain the maximum column index and the maximum data column index.
  3. Call the Cell.getColumn() method on the cell.
  4. Create a range based on the column.
  5. Obtain an iterator and traverse the range.
  6. Call the Cell.getRow() method on the cell.