0

In Google Sheet, I want to create a custom function to write a note based on cell reference's formula result. But based on the discussion on this link, I just able to write the notes ONLY when the direct change happened in the respective column.

Is there anyone able to help me to provide/edit the function to automatically write a notes based on cell's formula result change?

The sample document available here. Feel free to edit the copy sheet, you may create your own sheet if needed.

The custom function available below:

function onEdit(e) {
  var sheet = SpreadsheetApp.getActiveSheet();
  if (sheet.getName() == "Sheet1"){ //Change to your sheet name
    var sourceRange = e.source.getActiveRange();
    var sourceRow = sourceRange.getRow();
    var sourceColumn = sourceRange.getColumn();
    var sourceValue = sourceRange.getValue();
    if(sourceColumn == 2){ //Change to the column you want to get the value from
      var noteCell = sheet.getRange(sourceRow, 1); //The cell where the Note should be, B-column on the current row
      noteCell.setNote(sourceValue);
    }
  }
}

Thanks for your attention.

Your Answer

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

Browse other questions tagged or ask your own question.