本文介绍了如何“清除格式”在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表格通过应用程序脚本
发布评论