我需要一个按钮来清除细胞在谷歌小号preadsheet [英] I need a button to clear cells in a google spreadsheet

查看:145
本文介绍了我需要一个按钮来清除细胞在谷歌小号preadsheet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

林让我自己与谷歌小号preadsheets的工具,作为工具的一部分,我想有一个按钮,清除一组特定的细胞。据我了解,我需要插入一个绘图,然后脚本分配给该图形。麻烦的是,我不知道这里写我自己的话,即时寻找帮助的第一件事!

Im making a tool for myself with Google Spreadsheets, and as part of that tool I would like to have a button that clears a specific set of cells. As I understand it, I need to insert a drawing, and then assign a script to that drawing. Trouble is, I dont know the first thing about writing my own so, im here looking for help!

这样做的最终目标将是我有连接到它,将激活时,清除数据的脚本绘图(让他们空,但留下的颜色)从细胞中B7-G7。

The end goal of this would be for me to have a drawing with a script attached to it that would, when activated, clear the data (make them blank, but leave the color) from cells B7-G7.

你们可以提供任何帮助就太棒了!

Any help you guys could offer would be fantastic!

推荐答案

这样的剧本是很简单的,你应该看的 的教程来学习如何自己做。

Such script is very simple, you should look at the tutorials to learn how to do it yourself.

总之,这里是:

function clearRange() {
  //replace 'Sheet1' with your actual sheet name
  var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1');
  sheet.getRange('B7:G7').clearContent();
}

这篇关于我需要一个按钮来清除细胞在谷歌小号preadsheet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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