Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
Google Sheets - When clicking on a checkbox, I want the row to be cleared (not deleted), and also for the checkbox to then reset

I've been trying to figure this one out and I'm a bit lost...

This is what I have so far:

function deleteCheckedBoxes() {

const sheet = SpreadsheetApp.getActiveSheet();

const activeRange = sheet.getActiveRange();
const activeRow = activeRange.getRow();
const activeColumn = activeRange.getColumn();

let rangeUpdatedValue =  activeRange.getValue();

if(activeColumn == 5 && rangeUpdatedValue == true){

 sheet.deleteRow(activeRow);

};
  
}

How can I get it to clear the row instead of deleting it?

I have tried clearContent & ClearContents, but it doesn't seem to work

Any help would be greatly appreciated!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When your showing script is modified, how about the following modification?

From:

sheet.deleteRow(activeRow);

To:

sheet.getRange(activeRow, 1, 1, sheet.getLastColumn()).clearContent();
  • When this modified script is run, the row of the active range is cleared.
  • In this case, by clearContent(), the checkbox is unchecked.

Reference:

  • clearContent()
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!