I have an online work spreadsheet with random cells marked as Strikethrough. So far there is no functions on Google spreadsheet to filter or isolate these cells which are marked as Strikethrough.
I came across with Google function isStrikethrough()
but not sure if that can be used on app script.
What I am look as an outcome is to highlight the entire row if any cells in that row was marked Strikethrough.
This will be very helpful if someone can help me by creating an app script.
Thanks in advance :)
This should do it.
function lineThrough(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];//first sheet
var lr= sheet.getLastRow()
var lc=sheet.getLastColumn()
var range = sheet.getRange(2,1,lr,lc);
var results = range.getFontLines();
for (var i=0;i<lr;i++) {
for (var j=0;j<lc;j++ ) {
if(results[i][j]== "line-through"){
var color=sheet.getRange(i+2, 1,1,lc).setBackground("yellow")
}}
}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With