im trying to figure out how to make a button through script in google sheets thats going to be pressed on the cell that’s currently active, go through the entire column of cells to find a duplicate of the previous active cell, and then highlight the row that each duplicate cell is on. Any ideas?
function myfunction() {
const ss = SpreadsheetApp.getActive();
const sh = ss.getActiveSheet();
sh.getDataRange().setBackground("#ffffff");
SpreadsheetApp.flush();
const v = sh.getActiveRange().getValue();
let lo = PropertiesService.getScriptProperties().getProperty('lastone');
PropertiesService.getScriptProperties().setProperty('lastone', v);
if (lo) {
let tf = sh.createTextFinder(lo).matchEntireCell(true).findAll();
tf.forEach(f => {
sh.getRange(f.getRow(),1,1,sh.getLastColumn()).setBackground("#ffff00");
});
}
SpreadsheetApp.flush();
}