如何运行javascript byc点击谷歌表格中的单元格? [英] How to run javascript byc clicking a cell in google sheets?

查看:76
本文介绍了如何运行javascript byc点击谷歌表格中的单元格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google表格允许您使用JavaScript编写脚本,与Excel一样,您可以编写VBA来自动执行任务。



我想在我的电脑中创建一个单元格谷歌电子表格可点击,所以当它被点击时,我的函数将运行。

我发现可以通过插入绘图创建自定义按钮, d真的很喜欢这是任何时候点击一个特定的单元格,而不是一个可以在表单中移动和看起来很尴尬的按钮。



是否有可能?



感谢您的任何建议。

解决方案

cell 但你可以做什么指示用户按照 https://developers.google.com/apps-script/execution_custom_functions?hl=es#using



同样,您可以使用公式预先填充单元格,并简单地要求用户编辑它,然后按Enter键以运行该函数。

Google sheets allows you to write scripts in javascript, the same way excel lets you write VBA to automate tasks.

I'd like to make a cell in my google spreadsheet clickable, so that when it is clicked, my function will run.

I've found that it's possible to create custom buttons by inserting a drawing, but I'd really like this to be any time a particular cell is clicked, rather than a button which can move around and looks awkward in the sheet.

Is it possible?

Thanks for any advice.

解决方案

There is not an onClick event for cells but what you can do is instruct the user to enter your formula/custom function into the cell as described at https://developers.google.com/apps-script/execution_custom_functions?hl=es#using.

Similarly, you could have the cell pre-populated with the formula and simply ask the user to edit it and then press enter to run the function.

这篇关于如何运行javascript byc点击谷歌表格中的单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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