Remove duplicate rows in a Worksheet
Remove duplicate rows is one of Microsoft Excel’s many useful features. It allows users to remove duplicate rows in a Worksheet, you can pick which columns should be checked for duplicate information.
Aspose.Cells provides the Cells.RemoveDuplicates() method for this purpose. You can also set startRow, startColumn, endRow, endColumn to pick up columns.
Following are the sample files which can be downloaded for testing this feature:
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Create workbook | |
Workbook book = new Workbook("removeduplicates.xlsx"); | |
//Remove Duplicate | |
book.Worksheets[0].Cells.RemoveDuplicates(0 ,0, 5, 3); | |
//Save result | |
book.Save("removeduplicates-result.xlsx"); |