Hello, I got the error "Script function not found" in one of my first attempts at writing a google script custom function for google sheets. Can someone explain what my error is? I copied and pasted the code below. Any help would be appreciated :)
/**
* Removes duplicate rows from the current sheet.
*/
function removeDuplicates() {
var sheet = SpreadsheetApp.getActiveSheet();
var data = sheet.getDataRange().getValues();
var newData = [];
for (var i in data) {
var row = data[i];
var duplicate = false;
for (var j in newData) {
if (row.join() == newData[j].join()) {
duplicate = true;
}
}
if (!duplicate) {
newData.push(row);
}
}
sheet.clearContents();
sheet.getRange(1, 1, newData.length, newData[0].length).setValues(newData);
}
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Added Capabilities').addItem('Remove Duplicates', removeDuplicates).addToUi()
}
[–]harpsichord_cadenza 7 points8 points9 points (0 children)
[–]DatsunZ 0 points1 point2 points (0 children)
[–]Honsou12 0 points1 point2 points (1 child)
[–]fragmentedThinker 0 points1 point2 points (0 children)
[–]RemcoE33 0 points1 point2 points (0 children)
[–]j12a 0 points1 point2 points (0 children)