Created
August 28, 2018 07:33
-
-
Save eojji/0fe300832b7426464a1c7bdda1ebe92e to your computer and use it in GitHub Desktop.
Find duplicate rows in the spreadsheet with the eq function and delete them. https://cafe.naver.com/eojji/365
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFunction() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheets()[0]; | |
var value; | |
var i = 0; | |
var thisRow = 2; | |
do { | |
value = sheet.getRange(thisRow, 1).getValue(); | |
if (value) { | |
thisRow++; | |
} else { | |
sheet.deleteRow(thisRow); | |
} | |
i++; | |
} while (thisRow <= sheet.getLastRow() && i < 1000); | |
Logger.log('Row: %s', thisRow); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment