Skip to main content

Remove duplicate rows

Remove the rows of a range (or of the used area) that repeat an earlier row, comparing all columns or only the chosen ones, like Excel's Remove Duplicates; the first of each set is kept and the rows below move up inside the range.

Command in the Excel toolkit · id ooa.excel/remove_duplicates · 6 inputs, 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
RangeStringNoRange to check; the used area when empty.
First row is the headerBooleanNoThe first row is a header and is kept as it is; the workbook's open setting (true by default) when empty.
ColumnsListNoColumns that make a row a duplicate: header names, letters or 1-based sheet column numbers; all columns of the range when empty.
Match caseBooleanNofalseTreat "ACME" and "acme" as different; Excel treats them as the same.
SheetStringNoSheet name; active sheet when empty.
SessionStringNoexcelWorkbook session.

Outputs​

OutputTypeWhat it is
countNumberNumber of rows removed.
remainingNumberNumber of rows left in the range, the header row not counted.