Activating Sheets and Activating a Cell in Worksheet

Activating Sheets and Activating a Cell

Aspose.Cells provides specific API calls for activating a sheet and a cell. For Example, the WorksheetCollection.ActiveSheetIndex property is useful for setting the active sheet in a workbook. Similarly, the Worksheet.ActiveCell property can be used to set and get an active cell in the worksheet.

To make sure that the horizontal or vertical scrollbars are at the row and column index position you want to show specific data, use the Worksheet.FirstVisibleRow and Worksheet.FirstVisibleColumn properties.

The following example shows how to activate a worksheet and make an active cell in it. The following output is generated when executing the code. The scrollbars are scrolled to make the 2nd row and 2nd column as their first visible row and column.

Setting B2 cell as an active cell

todo:image_alt_text

Java code to set an active worksheet in Excel