我需要一个按钮来清除谷歌电子表格中的单元格 [英] I need a button to clear cells in a google spreadsheet

查看:13
本文介绍了我需要一个按钮来清除谷歌电子表格中的单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Google 电子表格为自己制作一个工具,作为该工具的一部分,我想要一个按钮来清除一组特定的单元格.据我了解,我需要插入一个绘图,然后为该绘图分配一个脚本.问题是,我不知道自己写的第一件事,所以我在这里寻求帮助!

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();
}

这篇关于我需要一个按钮来清除谷歌电子表格中的单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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