[英]copy cell values of named range in one sheet to same cell address of another named range in another sheet
Is it possible to copy the values of a named range in one sheet and paste them in the same cell location of another sheet? 是否可以在一张工作表中复制命名范围的值并将其粘贴到另一张工作表的相同单元格位置中?
For example, I have named range "old_desk_1"
in sheet1!A24:A25
and named range "desk_1"
in sheet2!A24:A25
. 例如,我有一个名为范围"old_desk_1"
在sheet1!A24:A25
并命名范围"desk_1"
在sheet2!A24:A25
。 Is it possible to copy the values in the cells of old_desk_1
to desk_1
without just doing the standard copy/paste? 是否可以仅执行标准的复制/粘贴old_desk_1
将desk_1
单元格中的值复制到desk_1
?
Yes it is, first I suggest looking at the following documentations. 是的,首先我建议您查看以下文档。
The above links will tell you about all the methods available for all the classes you will need to do this. 上面的链接将告诉您所有可用于所有类的方法。 Here is a basic example of what you're hoping to acheive. 这是您希望达到的基本示例。
function copyCells(){
var thisSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var theRange = thisSpreadsheet.getRangeByName("YOUR RANGE");
var destinationSheet = thisSpreadsheet.getSheetByName("SHEET TO COPY TO");
var destinationRange = destinationSheet.getRangeByName("YOUR OTHER RANGE");
theRange.copyTo(destinationRange);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.