带有PASTE_COLUMN_WIDTHS选项的Google脚本复制功能不起作用 [英] The Google script copy function with PASTE_COLUMN_WIDTHS option does not work
问题描述
在我的Google脚本中,我想扩展一系列的列并使列宽与现有的一组列相同,但手动Sheets命令仅粘贴列的宽度可以正常工作,但是脚本:
copyTo(columnRange,SpreadsheetApp.CopyPasteType.PASTE_COLUMN_WIDTHS)
不起作用。它复制值和格式而不是仅列宽。
有没有人有解决这个问题的方法?
sheet.getRange( 'B:B')。CopyTo从(sheet.getRange( 'C1'),SpreadsheetApp.CopyPasteType.PASTE_COLUMN_WIDTHS,FALSE);
您还需要指定 语法: In my Google script I want to extend a range of columns and make their column widths identical to an existing set of columns the manual Sheets command to paste only columns widths works fine but the script: does not work. It copies values and formats instead of just column widths. Does anyone have a workaround for this? You also need to specify SYNTAX: 这篇关于带有PASTE_COLUMN_WIDTHS选项的Google脚本复制功能不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!转置:第三个参数为
false
(可能默认为true)。
copyTo目的地,copyPasteType,转置)
copyTo(columnRange,SpreadsheetApp.CopyPasteType.PASTE_COLUMN_WIDTHS)
sheet.getRange('B:B').copyTo(sheet.getRange('C1'),SpreadsheetApp.CopyPasteType.PASTE_COLUMN_WIDTHS,false);
transposed
: the third argument to false
(which probably defaults to true).copyTo(destination, copyPasteType, transposed)