Google 电子表格的什么功能在单元格的右上角创建这个黑色箭头

What function of Google Spreadsheets create this black arrow in the top right corner of the cell

我正在尝试复制电子表格,但我似乎无法弄清楚这个黑色小箭头代表什么。

如有任何帮助,我们将不胜感激。

google spreadsheet cell with mysterious black arrow

这是某人添加的注释。如果您想阅读它,请将光标悬停在该单元格上,pop-up 简介将显示注释。如果要删除它,right-click 单元格并选择“删除注释”。

正如 所指出的,这实际上是一个注释(不是 评论)。这很重要,因为您可以使用 UI 将两者添加到单元格,但您可以 使用 [=57] 操作 note =] Apps 脚本。

这里您将如何使用 UI 添加注释/评论。

这里是注释和评论的比较。注释为黑色,评论为橙色。

看到它们都展开了。

如上所述,支持使用 Apps 脚本处理评论。为此有一个 feature request,但它尚未实施,并且考虑到它的年龄,它似乎没有任何优先权。

现在您真正要做的是读/写便条(不需要像您之前评论的那样使用 PNG 魔法)。这可以使用如下脚本来完成。我将上面的电子表格与两个单元格 My cell with noteMy cell with comment.

一起使用
function getAndSetNote(){
  // get spreadsheet attached to this script
  const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  // get sheet using its name
  const sheet = spreadsheet.getSheetByName("my-sheet");
  // get the cell which contains the note
  const cellWithNote = sheet.getRange(1, 1);
  // log the current note
  Logger.log(cellWithNote.getNote());
  // set the new note
  cellWithNote.setNote("This note was set using Apps Script!");
}

这个小脚本将获取注释、记录它并设置另一个注释。 这里是这个脚本的执行日志,向您展示它的工作原理。

这里新的注释从 This is a note 更改为 This note was set using Apps Script!