Insert or Delete Rows in an Excel Worksheet
Contents
[
Hide
]
When creating a new worksheet, or working with an existing worksheet, you might need to add extra rows or columns to accommodate data. At other times, you might need to delete rows or columns from specified positions in the worksheet.
Aspose.Cells for Python via .NET offers two methods for inserting and deleting rows: Cells.insert_rows and Cells.delete_rows. These methods are optimized for performance and do the job very quickly.
To insert or remove a number of rows, we recommend that you always use the Cells.insert_rows and Cells.delete_rows methods instead of using the Cells.insert_row or delete_row methods in a loop.
Aspose.Cells for Python via .NET works in the same way as Microsoft Excel does. When rows or columns are added, the worksheet content is shifted down and to the right. When rows or columns are removed, the worksheet content is shifted up or to the left. Any references in other worksheets and cells are updated when rows are added or removed.