I have a large sheet of server names, ~12,000 rows. I need to highlight any duplicate server names and then copy them to a new sheet. I have a script to highlight the cells, that works great (thank you Kurt Kaiser). But, I can't figure out how to write the duplicates (all instances) to a new sheet. Here's the snippet of the code that highlights the duplicates.
// Highlight all instances of duplicate values in a column
function highlightColumnDuplicates(indexes) {
var column = 1;
for (n = 0; n < indexes.length; n++) {
sheet.getRange(indexes[n] + 1, column).setBackground("yellow");
}
}
Any help would be appreciated.