A
A
Aleksandr2020-04-28 13:09:09
Google Sheets
Aleksandr, 2020-04-28 13:09:09

What can replace it or configure the standard "on editing" event trigger?

At this stage, I use the "on editing" trigger to call my function. In my scenario, editing different fields on the sheet occurs, and only when editing one specific cell should my function work. Everything works well, but with this organization, the trigger fires constantly when there are edits to the sheet and the call of triggers is limited and there is a danger of exceeding this limit.

How can I optimize the task if I need a function call only when one specific sheet cell is changed, instead of triggering on any editing.
(explanations: my function checks for a change in a specific one cell, if not, then it is not executed)
But this check occurs every time the entire sheet is edited, but I wanted to call it only when editing one specific cell.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2020-04-28
@iSeb

Checks if the cell being changed is a cell 'Лист 1'!B3:

/**
 *
 * @param {GoogleAppsScript.Events.SheetsOnEdit} e
 */
function onEdit(e) {
  if (!/^Лист 1$/.test(e.range.getSheet().getName())) return;
  if (!/^B3$/.test(e.range.getA1Notation())) return;
  SpreadsheetApp.getActive().toast('Работаем дальше');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question