This logic worked for me
<pre lang="c#">
row.Remove();
for (uint j = i; j < rowsCount-1; j++)
{
rows.ToArray()[j].RowIndex.Value = rows.ToArray()[j].RowIndex.Value - 1;
foreach (Cell c in rows.ToArray()[j])
{
c.CellReference.Value = c.CellReference.Value.Substring(0, 1) +
(uint.Parse(c.CellReference.Value.Substring(1, c.CellReference.Value.Length - 1))-1);
}
}
rowsCount--;
worksheetPart.Worksheet.Save();