Sammed Bagwade

Sammed Bagwade

  • NA
  • 7
  • 623

Update new data under specific header in excel using C#

Aug 26 2018 4:25 AM
I have excel file which has data like below table. Where "Reviewer", "Comments" these are cell header with having some data. so my requirement is to insert new data in the same excel file in next empty line under the respective header.

Reviewer | Comments | Comment Type |Comment Date
---------------------------------------------------------------
rajdra1 1 | Read loud | Sticky Note | 08/09/2018
rajdra1 1 | MSTP | Highlight | 08/09/2018
rajdra1 2 | Readout | Underline | 08/09/2018
rajdra1 2 | A few | Inserted Text | 08/09/2018
rajdra1 2 | Not required | Highlight | 08/09/2018

So how to read all cell as per header name update data under specific header c#


suppose my new data is -

Reviewer - "ABC"
Comments - "myComment"
Comment Type - "Highlight"
Comment Date - "09/09/2018"

expected output -

Reviewer | Comments | Comment Type |Comment Date
---------------------------------------------------------------
rajdra1 1 | Read loud | Sticky Note | 08/09/2018
rajdra1 1 | MSTP | Highlight | 08/09/2018
rajdra1 2 | Readout | Underline | 08/09/2018
rajdra1 2 | A few | Inserted Text | 08/09/2018
rajdra1 2 | Not required | Highlight | 08/09/2018
ABC | myComment | Highlight | 09/09/2018

Answers (1)