是否可以使用Google表格为Notes设置自动插入的值? [英] Is it possible to set Notes with automatically inserted values using google sheets?

查看:55
本文介绍了是否可以使用Google表格为Notes设置自动插入的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在特定单元格中输入内容时,我试图找出一种自动插入Notes的方法.有人向我建议了此线程并对其进行了尝试: https://support.google .com/docs/thread/13317657?hl = zh_CN .我更改了提到的功能,以适应我的项目:

I was trying to figure out a way to insert Notes automatically, when i enter something in a specific cell. This thread was suggested to me and tried it out: https://support.google.com/docs/thread/13317657?hl=en. I changed the function mentioned a littlebit, to fit my project:

function onEdit(e) {
  if(e.source.getActiveSheet().getName() === 'Testsheet') { 
    if(e.range.columnStart === 8 && (e.range.rowStart > 12 && e.range.rowStart < 21)) {
        return e.range.offset(0, -6).setNote(e.value);  
      }
    }
  }

这样,当我在H13:H20范围内输入值时,在相应的(0,-6)偏移单元格上将插入与Notes相同的值.这是朝正确方向迈出的一步,但还不是我真正想要实现的目标.问题是,只有在手动输入值时,这才起作用.但是对于我的项目,我需要设置注释,当值自动填充时,使用一个函数来连续填充某些信息,具体取决于所选的下拉选项.

This way when I enter values in the range H13:H20, the same values get inserted as Notes on the corresponding (0, -6) offset cells. Which is a step in the right direction, but not yet what I'm truly trying to achieve. The problem is, this only works, when the values are entered manually. But for my project, I need the notes also to be set, when values are filled in automatically, using a function that fills in certain information in a row, depending on the selected dropdown choice.

在我的工作表中,例如:

In my sheet for example:

=if(B17="Test1",Testsheet!C10:Testsheet!H10) 当信息以这种方式填写时,它不会在偏移单元格中给我注释.有办法吗?

=if(B17="Test1",Testsheet!C10:Testsheet!H10) When the Information is filled in that way, it doesn't give me the Note in the offset cell. Is there a way, so that it does?

这里是指向我的测试表的链接,您可以在其中查看我要执行的操作: https://docs.google.com/spreadsheets/d/16c2hVDM_FTnHWerKjnOauCopwVZSnKCwAMVi6-Z8vBo/edit?usp=sharing

Here is a link to my Testsheet, where you can see what I'm trying to do : https://docs.google.com/spreadsheets/d/16c2hVDM_FTnHWerKjnOauCopwVZSnKCwAMVi6-Z8vBo/edit?usp=sharing

谢谢您的提示和帮助!

推荐答案

如您在文档:

脚本执行和API请求不会导致触发器运行.为了 例如,调用Range.setValue()编辑单元格不会导致 电子表格的onEdit触发器即可运行.

Script executions and API requests do not cause triggers to run. For example, calling Range.setValue() to edit a cell does not cause the spreadsheet's onEdit trigger to run.

唯一的选择是直接使用值作为参数运行notes函数,而不是插入第16行"值,因为通过脚本或公式更新工作表不会触发函数onEdit().

The only option would be to directly run the notes function with the values as parameter instead of inserting the "row 16" values, as updating the sheet by a script or formula won't trigger the function onEdit().

这篇关于是否可以使用Google表格为Notes设置自动插入的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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