我正在尝试为Google Spreadsheet编写一个函数,用于查找组的第一列和最后一列.然后隐藏该组,或者如果它已经隐藏则显示该组.
但是,我无法找到确定列是否隐藏的方法.我在Google的"课程表"页面https://developers.google.com/apps-script/reference/spreadsheet/sheet上找不到任何内容,但我找不到与Excel相同的内容.hidden
getColumnWidth(column)返回未隐藏的列宽,即使它被隐藏.
这是我的代码:
function hideShowColumns(startCol, endCol) {
//endCol is one column past the last data set that should be hidden
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Transposed Data");
//import the data from the Column Headers
var colHeaderData = sheet.getRange(1, 1, 2, sheet.getMaxColumns()).getValues();
var startColNum = 0;
var endColNum = 0;
// This section searches for the column names in the header rows and returns their column number
for (var i =0; i < 2; ++i) {
for (var j …Run Code Online (Sandbox Code Playgroud)