在Google表格中设置相关便笺

我正在寻找一种自动生成注释的方法,具体取决于另一个单元格的内容。例如:A1的文本为“ xy”,我希望B1的文本为“ xy”作为注释。如果我更改A1的文本,我也希望B1的音符也更改。这一定是可以实现的,对吧?

yanlovey 回答:在Google表格中设置相关便笺

您可以捕获EDIT事件并更新笔记

/**
 * @file Updates notes in the second column if there have been edits in the first one.
 * @url https://stackoverflow.com/questions/58685598/set-dependent-notes-in-google-sheets
 */

/**
 * @param {GoogleAppsScript.Events.SheetsOnEdit} e
 */
function onEdit(e) {
  if (e.range.getColumn() === 1)
    e.range.offset(0,1).setNotes(e.range.getValues());
}
本文链接:https://www.f2er.com/3169737.html

大家都在问