如何“清除格式”在Google表格通过应用程序脚本

编程入门 行业动态 更新时间:2024-10-23 06:23:13
本文介绍了如何“清除格式”在Google表格通过应用程序脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的Google表格中,我现在通过手动删除格式>清除格式化。

In my Google Sheet, I currently remove formatting by manually going to Format > Clear Formatting.

如何以编程方式(通过Apps脚本)清除Google表格行中可能存在的任何格式/和/或列?

How can I programmatically (via Apps Script) clear any/all formatting that may exist in a Google Sheet's row(s) and/or column(s)?

澄清:我知道格式>相同的操作清除格式在主菜单中可用的函数。

Clarification: I am aware of the Text Class that has formatting functions (eg. setForegroundColor(), setItalic(), setTextAlignment(), etc), but I'm not aware of any single function that will do the same thing as the Format > Clear Formatting function that is available in the Main Menu.

推荐答案

Example from the docs:

// This example assumes there is a sheet named "first" var ss = SpreadsheetApp.getActiveSpreadsheet(); var first = ss.getSheetByName("first"); first.clearFormats();

更多推荐

如何“清除格式”在Google表格通过应用程序脚本

本文发布于:2023-10-12 17:17:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1485358.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   脚本   表格   格式   Google

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!