Google Sheet Script onEdit(e) if H2=Yes then make Column I (Checkbox) pressable

MrrrDude

I'm trying to find a specifc conditional format for a scenario on google sheet but I was unable to find anything regarding this (than changing color, format text etc).

Is it possible to write an onEdit(e) script that conditions if column Hn==Yes then make column I(checkbox) available to be pressed?

I tried with setFrozenColumns(9) is H column is blank or No but it doesn't work.

function chechBox(e) {

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sh = e.range.getSheet();
  var range = e.range;
  if(sh.getName()!="Test")return;
  var colHValue=sh.getRange(e.range.rowStart,8).getValue()
  if (range.getColumn()==8 & colHValue==0 & colHValue=="No"){
    sh.setFrozenColumns(9);
  }
};

Thank you, M

Cooper

Try it this way:

function chechBox(e) {
  var sh = e.range.getSheet();
  if(sh.getName()!="Test")return;
  var colHValue=sh.getRange(e.range.rowStart,8).getValue();
  if (e.range.columnStart==8 && (colHValue==0 || colHValue=="No" )){
    sh.setFrozenColumns(9);
  }
}

I'm not sure where you wanted to do this:

if(sh.getRange('H2').getValue()=="Yes")sh.getRange('I2').insertCheckboxes();

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I make a 'google sheet script' or formula to change values in different cells based on a checkbox in the sheet

How do I make my script target a specific column in Google Sheet?

google sheet script yes no and X dialog box

I am trying to make a google sheet that when I click a checkbox, it will clear the row and reset the the checkbox to unchecked

Google script - Hide/Unhide google sheet based on checkbox on another sheet

Google sheet script replace True value with checkbox only if value is true on 4 different column

Can I use Google Apps Script to make a Google Form display randomized text from a Google Sheet?

How can I make this curved svg pressable?

Google script for move rows depending on checkbox - Google sheet

Using Google Apps Script, how can I replace text in a Google Sheets template to make a new Sheet?

How to make a loop script for Google sheet?

google sheet formula, if “yes”, copy to other sheet

I want to make a script in Google sheet to find and match strings of texts between different sheets

How can I make a Google Sheet script run reliably on Samsung tablets?

Google App Script, updates to sheet are not being found by rest of script. How do I make it include updates previously done in the script?

Checkbox in Google Sheet

Google Sheets - How can I copy 11 columns of data after enabling a checkbox on column A and sending that data to another sheet?

How can I assign a Google Sheet script to only one sheet?

Google Sheet Apps Script: How do I edit the Apps Script below to only copy over data from Column A to L and P to S?

Copy values from a sheet to another sheet when checkbox is checked using Google Script

If column contains text add a checkbox in column apps script google sheets

Populate Google sheet with file names from folder on Google drive and add checkbox Google Script

Script to the active Sheet on Google Sheet

Application or script that can generate folder structure + make a copy of a google sheet?

How to make a script in GAS that will create a button or its equivalent in a Google Sheet?

How do I automatically archive a google sheet with a google script?

Google Script: Append new values in column to another sheet

Google sheet script : Delete row depending on column content

Automating date of a column in Google Sheet using Apps Script