获取单元格注释值 [英] Get cell note value

查看:42
本文介绍了获取单元格注释值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以获取单元格注释值并在其旁边的单元格中显示所有注释?

Is there a way to get cell note value and display the all the note in the cell next to it?

我有C列,其中某些单元格包含注释.我想获取这些注释值,并将每个单元格注释写在D列中它旁边的单元格中.

I have a column C where some of the cells contain note. I would like to get these note value and write each cell note in the cell next to it in column D.

例如:如果单元格C4的注释为"No entry",我想在D4中显示"No entry".

For example: if cell C4 has a note "No entry", I want to display "No entry" in D4.

谢谢.

亚历克斯

推荐答案

我今天需要这样做,发现了您的问题,但没有答案.这就是我最终想出的.您可以通过在脚本编辑器中设置名为getNote的函数来完成此操作.

I needed to do this today and found your question but no answer. This is what I finally came up with. You can do this by setting up a function in the script editor named getNote.

function getNote(cell)
{
   var ss = SpreadsheetApp.getActiveSpreadsheet();
   var range = ss.getRange(cell)
   return range.getNote();
}

然后在电子表格中输入:

then in your spreadsheet enter:

=getNote("C4")

从单元格C4获取笔记.如果您希望它成为在单元格中移动时会发生变化的参考,请通过以下方式进行参考:

to get the note from cell C4. If you want it to be a reference that changes when you move around the cells, then reference it this way:

=getNote(Address(row(C4), column(C4)))

注意事项:注释不会触发刷新,因此,如果编辑了注释,则单元格不会立即获取新值

Word of caution: Notes don't trigger a refresh, so if a note is edited the cell does not pick up the new value right away

这篇关于获取单元格注释值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆