vendredi 26 août 2022

(Google Sheets) Is there a way to have a checkbox toggle the text color of a set range?

I have a Google Sheets document and there is a dynamic list that gets created in a certain range (J19:L26) that has some personal data in it. Is there a way to make a checkbox or something quick I can click (even a button?) that can set the text to white or background to black to hide it to onlookers? I currently have the checkbox in cell M17

I have the following code that executes fine but then when I check the box in M17 nothing happens. Maybe I missed a step somewhere? I am new to Google sheets coding. I just wrote the function, tested it Runs, then closed it. Maybe I am just missing a step(s) in implementing the function to my sheet or my function Runs but doesn't do what I need it to?

function Privacy() {
  var TheBoard = SpreadsheetApp.getActiveSpreadsheet();
  var TheRange = TheBoard.getRange("Board!J19:L26");
  if(TheBoard.getRange("Board!M17") == "TRUE")
  {
    TheBoard.getRange(TheRange).setFontColor('white');    
  } 
}



Aucun commentaire:

Enregistrer un commentaire