title: How to apply cell style to each cell in new row from previous row
body: <p>I have an excel sheet which contains previously some values with some formatting. I would like to add a new row programmatically using c#. How can I apply styling of previous row to this newly added row during insert operation? </p>
  
  <p>The code that I am using is as below:</p>
  
  <pre><code>Application excelApp = new Application();
              Workbooks workBooks = excelApp.Workbooks;
              Workbook workBook = excelApp.Workbooks.Open(fileName, Type.Missing, false, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, true, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
  
              int nTotalSheets = workBook.Worksheets.Count;
  
              Worksheet workSheet = workBook.Worksheets[1];
              int nColumns = workSheet.UsedRange.Columns.Count;
              int nRows = workSheet.UsedRange.Rows.Count;
              workSheet.Cells[nRows + 1, 1] = "Test";
              Range excelRange = workSheet.UsedRange;
              workBook.Close(true, fileName, false);
              Marshal.ReleaseComObject(workBook);
  </code></pre>