1

I would like to use this code :

function onEdit(e) {
  if(e.range.rowStart === 1 && e.range.columnStart === 1) { 
    e.range.offset(0,1).clearContent();
  }
}

but only on a tab called 'Inventory'.
Could you kindly help?

0

The IF statement in your onEdit(e) script already tests for row and column. You want to test for sheet name also.

This isn't an uncommon question and yours is close duplicate of Google Script onedit(e) event restricted to a specific sheet and specific range with a good answer by @Tanaike.

In your case, extend your if statement like this:

if(e.range.rowStart === 1 && e.range.columnStart === 1 && e.source.getSheetName() === "Inventory") {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.