Skip to content

Instantly share code, notes, and snippets.

@sohail-aspose
Created December 23, 2020 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sohail-aspose/e0b5fa34b542212ea63edcd83630464b to your computer and use it in GitHub Desktop.
Save sohail-aspose/e0b5fa34b542212ea63edcd83630464b to your computer and use it in GitHub Desktop.
Delete Blank Rows from all Worksheets in an Excel file.
// Open an existing excel file.
Workbook workbook = new Workbook("SampleInput.xlsx");
// Iterate over the worksheets.
foreach (Worksheet sheet in workbook.Worksheets)
{
// Delete the Blank Rows from the worksheet.
sheet.Cells.DeleteBlankRows();
}
// Save the excel file.
workbook.Save("SampleOutput.xlsx");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment