ExcelScript.RemoveDuplicatesResult interface
Represents the results from Range.removeDuplicates
.
Remarks
Examples
/**
* This script removes duplicate rows from a range.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the used range of the active worksheet.
const usedRange = workbook.getActiveWorksheet().getUsedRange();
// Remove any row that has a same value in the 0-indexed column as a previous row.
const removedResults: ExcelScript.RemoveDuplicatesResult = usedRange.removeDuplicates([0], true);
// Log the count of removed rows.
console.log(`Rows removed: ${removedResults.getRemoved()}.`);
}
Methods
get |
Number of duplicated rows removed by the operation. |
get |
Number of remaining unique rows present in the resulting range. |
Method Details
getRemoved()
Number of duplicated rows removed by the operation.
getRemoved(): number;
Returns
number
getUniqueRemaining()
Number of remaining unique rows present in the resulting range.
getUniqueRemaining(): number;
Returns
number
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Scripts