Keeps the first copy of each identical row in the active sheet.
function removeDuplicates() {
const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getDataRange();
range.removeDuplicates();
}Undo: Edit > Undo, or restore from File > Version history.
Reference: Apps Script documentation.
Facts on this page checked December 4, 2026 (Pacific) against the linked official sources.