Cells.CopyRow doesn’t copy the row formatting !!!
Documentation for Cells.CopyRow states that method will copy the entire row and formatting.
I have a template with the header (first row) defined and configured in Excel. Some columns have a Date Format and also have hidden columns.
When I have used code below I have created new Worksheet and copied row did not have original:
- Column size
- Column format
- Text alignment
- All hidden columns become unhidden .
Cells firstRowToCopy = this.lastUsedWorkSheet.Cells; // We will copy this row to the new worksheet.
// Copy headers.
this.lastUsedWorkSheet.Cells.CopyRow(firstRowToCopy, sourceRowIndex, destinationRowIndex);