Answer the question
In order to leave comments, you need to log in
How to highlight active cell row in google sheet?
Work is being done in large tables and it is not convenient to substitute the ruler to the screen to see what the active cell belongs to. I tried using conditional formatting as it was done in EXCEL, but it does not work, the macro from EXCEL cannot be transferred either. I'm at a dead end!
Answer the question
In order to leave comments, you need to log in
You can try this function:
But it overwrites the background of the cells and does not work instantly.
function onSelectionChange ( e ) {
let cache = CacheService.getDocumentCache();
let range = e.range;
let oldRow = cache.get("oldRow");
if ( oldRow > 0 ) {
e.source.getRange(oldRow+":"+oldRow).setBackground("#fff");
}
if ( range.getNumRows() === 1 ) {
let row = range.getRow();
e.source.getRange(row+":"+row).setBackground("#f3f3f3");
cache.put("oldRow", row);
}
}
function onSelectionChange ( e ) {
let range = e.range;
e.source.getRange("A:A").setValue("");
if ( range.getNumRows() === 1 ) {
let row = range.getRow();
e.source.getRange("A"+row).setValue("SELECTED");
}
}
=IF($A1 = "SELECTED"; TRUE; FALSE)
If you use conditional formatting, it's easy. We set up for the first column so when we set 0 in the first column, the color of the line turns on, telling us about editing it. When we finish exercising with this line, we simply put one - the work is finished, and the line is marked with a different color. Even so))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question