如何使用应用程序脚本在谷歌电子表格中的单元格中添加用户界面? [英] How do you add UI inside cells in a google spreadsheet using app script?

查看:113
本文介绍了如何使用应用程序脚本在谷歌电子表格中的单元格中添加用户界面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为Google文档电子表格中的特定单元格添加按钮。 应用脚本用户界面文档介绍了如何添加新面板,但尚不清楚UI在该面板可以连接到特定的行或单元格。

I'd like to add buttons to specific cells in Google docs spreadsheet. The apps script UI documentation talks about how to add a new panel, but it's not clear how UI in that panel could be attached to specific rows or cells.

是否可以将UI添加到特定的单元格,还是仅限于添加新的面板?

Is it possible to add UI to particular cells, or are we limited to adding new panels?

推荐答案

应用程序用户界面仅适用于面板。

The apps UI only works for panels.

自己绘制一个按钮并将其放入电子表格中。比你可以添加一个宏。

The best you can do is to draw a button yourself and put that into your spreadsheet. Than you can add a macro to it.

进入插入>绘图...,绘制一个按钮并将其添加到电子表格中。
单击它并单击分配宏...,然后在其中插入要执行的函数的名称。该功能必须在电子表格的脚本中定义。

Go into "Insert > Drawing...", Draw a button and add it to the spreadsheet. Than click it and click "assign Macro...", then insert the name of the function you wish to execute there. The function must be defined in a script in the spreadsheet.

或者,您也可以在其他位置绘制按钮并将其作为图像插入。

Alternatively you can also draw the button somewhere else and insert it as an image.

更多信息: https:/ /developers.google.com/apps-script/guides/menus



这篇关于如何使用应用程序脚本在谷歌电子表格中的单元格中添加用户界面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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