Created
December 20, 2017 07:10
-
-
Save AkshaySapra/dd96a90bb8b204596656d406b3398d83 to your computer and use it in GitHub Desktop.
Google sheets script for highlighting all duplicates, except for FIRST instance
This file contains 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
//Modify the parameters i and j to capture the range of your sheet. J indicates rows and i indicates columns | |
function appendString() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
var map = {}; | |
for (var j = 1; j < 119; j++) | |
{ | |
for (var i = 1; i < 10; i++) | |
{ | |
var currentValue = sheet.getRange(j,i).getValue(); | |
if (!currentValue==""){ | |
if (currentValue in map) | |
{ | |
sheet.getRange(j,i).setBackground("pink"); | |
} | |
else | |
map[currentValue] = 1; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment