How to use InsertRow mantaining the format of the previous row....

Nov 8, 2012 at 9:06 AM

When using Excel.Interop there was a fantastic command that let you add a row keeping the format of the above row..."row.Insert(Excel.XlInsertShiftDirection.xlShiftDown, false)"

Unfortunately I cannot manage to replicate the same functionality in EPPlus.

I tried "InsertRow", but this adds a brand new row loosing the format of the above row.

Please help.



Nov 12, 2012 at 5:52 AM

You can use ExcelWorksheet.InsertRow(int rowFrom, int rows, intCopyStylesFromRow);

Dec 21, 2013 at 6:59 AM
Hi Robert,

Thanks it worked. But there is one more issue with the formatting being returned. If the above row contains some merged cells those don't appear to be copied to the new rows. Is there any other way to create new rows with the merged property being retained?


Kiran Shenvi