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

getRemoved()

Number of duplicated rows removed by the operation.

getUniqueRemaining()

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